diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index d5e88d773f67..52b9c3ab5f55 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -125,7 +125,7 @@ addEnvHooks "$targetOffset" addCMakeParams makeCmakeFindLibs(){ isystem_seen= iframework_seen= - for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do + 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}"