cmake: process -iframework in setup-hook

This fixes a regression in #26197

Fixes: f496357585 ('cc-wrapper: use -iframework instead of -F')
This commit is contained in:
Dmitry Kalinkin 2019-10-11 17:24:33 -04:00
parent a7c52c451e
commit c8041d97a5
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333

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