Merge pull request #70997 from veprbl/pr/cmake_iframework

cmake: process -iframework in setup-hook
This commit is contained in:
Dmitry Kalinkin 2019-10-13 07:33:35 -04:00 committed by GitHub
commit 5d19c11efe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,12 +124,17 @@ addEnvHooks "$targetOffset" addCMakeParams
makeCmakeFindLibs(){
isystem_seen=
iframework_seen=
for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do
if test -n "$isystem_seen" && test -d "$flag"; then
isystem_seen=
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag}"
elif test -n "$iframework_seen" && test -d "$flag"; then
iframework_seen=
export CMAKE_FRAMEWORK_PATH="$CMAKE_FRAMEWORK_PATH${CMAKE_FRAMEWORK_PATH:+:}${flag}"
else
isystem_seen=
iframework_seen=
case $flag in
-I*)
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
@ -143,6 +148,9 @@ makeCmakeFindLibs(){
-isystem)
isystem_seen=1
;;
-iframework)
iframework_seen=1
;;
esac
fi
done