3
0
Fork 0
forked from mirrors/nixpkgs

cmake: update setup-hook to take -isystem instead of -I into account

This commit is contained in:
Michael Raskin 2016-09-08 09:10:00 +02:00
parent 78178d5854
commit dabf09aa92

View file

@ -70,15 +70,25 @@ else
fi
makeCmakeFindLibs(){
isystem_seen=
for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do
case $flag in
-I*)
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
;;
-L*)
export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
;;
esac
if test -n "$isystem_seen" && test -d "$flag"; then
isystem_seen=
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag}"
else
isystem_seen=
case $flag in
-I*)
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
;;
-L*)
export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
;;
-isystem)
isystem_seen=1
;;
esac
fi
done
}