[CMake] Cleaning up some CMake warnings
In Bootstrap builds Clang logs some warnings. These are caused because Clang passes CLANG_STAGE and BOOTSTRAP_DEFAULT_PASSTHROUGH into the next stage's configuration. BOOTSTRAP_DEFAULT_PASSTHROUGH shouldn't be passed, so it is renamed to _BOOTSTRAP_DEFAULT_PASSTHROUGH, to prevent passthrough. CLANG_STAGE should be passed, so I've changed the code to log it if it is set outside the if(CLANG_ENABLE_BOOTSTRAP) block. This makes the variable always used, so the warning goes away. llvm-svn: 276674
This commit is contained in:
parent
705f7775bb
commit
c486541fea
|
@ -463,12 +463,15 @@ endif()
|
||||||
|
|
||||||
add_subdirectory(cmake/modules)
|
add_subdirectory(cmake/modules)
|
||||||
|
|
||||||
|
if(CLANG_STAGE)
|
||||||
|
message(STATUS "Setting current clang stage to: ${CLANG_STAGE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CLANG_ENABLE_BOOTSTRAP)
|
if (CLANG_ENABLE_BOOTSTRAP)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
if(NOT CLANG_STAGE)
|
if(NOT CLANG_STAGE)
|
||||||
set(CLANG_STAGE stage1)
|
set(CLANG_STAGE stage1)
|
||||||
message(STATUS "Setting current clang stage to: ${CLANG_STAGE}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(REGEX MATCH "stage([0-9]*)" MATCHED_STAGE "${CLANG_STAGE}")
|
string(REGEX MATCH "stage([0-9]*)" MATCHED_STAGE "${CLANG_STAGE}")
|
||||||
|
@ -526,7 +529,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
|
||||||
set(verbose -DCMAKE_VERBOSE_MAKEFILE=On)
|
set(verbose -DCMAKE_VERBOSE_MAKEFILE=On)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BOOTSTRAP_DEFAULT_PASSTHROUGH
|
set(_BOOTSTRAP_DEFAULT_PASSTHROUGH
|
||||||
PACKAGE_VERSION
|
PACKAGE_VERSION
|
||||||
LLVM_VERSION_MAJOR
|
LLVM_VERSION_MAJOR
|
||||||
LLVM_VERSION_MINOR
|
LLVM_VERSION_MINOR
|
||||||
|
@ -577,7 +580,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# 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(${variableName})
|
if(${variableName})
|
||||||
string(REPLACE ";" "\;" value ${${variableName}})
|
string(REPLACE ";" "\;" value ${${variableName}})
|
||||||
list(APPEND PASSTHROUGH_VARIABLES
|
list(APPEND PASSTHROUGH_VARIABLES
|
||||||
|
|
Loading…
Reference in New Issue