]> granicus.if.org Git - clang/commitdiff
[CMake] Check if passthrough variables are defined
authorChris Bieneman <beanz@apple.com>
Wed, 21 Sep 2016 23:24:15 +0000 (23:24 +0000)
committerChris Bieneman <beanz@apple.com>
Wed, 21 Sep 2016 23:24:15 +0000 (23:24 +0000)
Checking if they evaluate to true cases prevents passing values that evaluate to false cases. Instead we should check if the variables are defined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282122 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 12f79df6e229846fb38d10648aea33c3ef787a7e..9b7322e279be53f76fba0094e7ae8a4fc110e2ca 100644 (file)
@@ -610,7 +610,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
 
   # Populate the passthrough variables
   foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH})
-    if(${variableName})
+    if(DEFINED ${variableName})
       string(REPLACE ";" "\;" value ${${variableName}})
       list(APPEND PASSTHROUGH_VARIABLES
         -D${variableName}=${value})