Silence some CMake 3.3 dev warnings in compiler-rt
Fix a trivial instance of CMP0054 that came up on llvmdev.
The other warnings were CMP0057, which is about using the same file as a
MAIN_DEPENDENCY multiple times. The old behavior hasn't been a problem
yet, so I silenced the warning and filed PR23595 to document the issue
if someone cares.
llvm-svn: 237808
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 0d8a880..51620eb 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -38,6 +38,12 @@
if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
endif()
+ # PR23595: We use add_custom_command with the same MAIN_DEPENDENCY source file
+ # multiple times to compile for multiple architectures. CMake 3.3+ will error
+ # on this because it breaks some generators, but it hasn't been a problem yet.
+ if(POLICY CMP0057)
+ cmake_policy(SET CMP0057 OLD)
+ endif()
endif()
# Top level target used to build all compiler-rt libraries.
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 0fdb784..f7f60a4 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -52,7 +52,7 @@
macro(append_have_file_definition filename varname list)
check_include_file("${filename}" "${varname}")
- if (NOT "${varname}")
+ if (NOT ${varname})
set("${varname}" 0)
endif()
list(APPEND ${list} "${varname}=${${varname}}")