[compiler-rt] r237808 - Silence some CMake 3.3 dev warnings in compiler-rt

Reid Kleckner reid at kleckner.net
Wed May 20 09:56:18 PDT 2015


Author: rnk
Date: Wed May 20 11:56:17 2015
New Revision: 237808

URL: http://llvm.org/viewvc/llvm-project?rev=237808&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=237808&r1=237807&r2=237808&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Wed May 20 11:56:17 2015
@@ -38,6 +38,12 @@ else()
   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.

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake?rev=237808&r1=237807&r2=237808&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake Wed May 20 11:56:17 2015
@@ -52,7 +52,7 @@ endmacro()
 
 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}}")





More information about the llvm-commits mailing list