[CMake] More robust handling for bootstrap variables

Checking defined isn't good enough we also need to handle defined to empty string.

llvm-svn: 282125
This commit is contained in:
Chris Bieneman 2016-09-22 00:18:12 +00:00
parent d273aab55b
commit 725acc4d85
1 changed files with 5 additions and 1 deletions

View File

@ -611,7 +611,11 @@ if (CLANG_ENABLE_BOOTSTRAP)
# Populate the passthrough variables # Populate the passthrough variables
foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH}) foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH})
if(DEFINED ${variableName}) if(DEFINED ${variableName})
string(REPLACE ";" "\;" value ${${variableName}}) if("${${variableName}}" STREQUAL "")
set(value "")
else()
string(REPLACE ";" "\;" value ${${variableName}})
endif()
list(APPEND PASSTHROUGH_VARIABLES list(APPEND PASSTHROUGH_VARIABLES
-D${variableName}=${value}) -D${variableName}=${value})
endif() endif()