about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper')
-rwxr-xr-xnixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper b/nixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper
new file mode 100755
index 000000000000..3fd37902cf2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/analysis/include-what-you-use/wrapper
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+buildcpath() {
+  local path after
+  while (( $# )); do
+    case $1 in
+        -isystem)
+            shift
+            path=$path${path:+':'}$1
+            ;;
+        -idirafter)
+            shift
+            after=$after${after:+':'}$1
+            ;;
+    esac
+    shift
+  done
+  echo $path${after:+':'}$after
+}
+
+export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
+                                               $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include
+export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
+                                                                                      $(<@clang@/nix-support/libcxx-cxxflags) \
+                                                                                      $(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include
+exec -a "$0" @out@/bin/.$(basename $0)-unwrapped "$@"