[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.

llvm-svn: 282122

clang/CMakeLists.txt

index 12f79df..9b7322e 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})