[compiler-rt] r202023 - [CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt libraries are build by 'make all' command

Alexey Samsonov samsonov at google.com
Mon Feb 24 03:32:49 PST 2014


Author: samsonov
Date: Mon Feb 24 05:32:49 2014
New Revision: 202023

URL: http://llvm.org/viewvc/llvm-project?rev=202023&view=rev
Log:
[CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt libraries are build by 'make all' command

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

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=202023&r1=202022&r2=202023&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Feb 24 05:32:49 2014
@@ -27,7 +27,7 @@ else()
 endif()
 
 # Top level target used to build all compiler-rt libraries.
-add_custom_target(compiler-rt)
+add_custom_target(compiler-rt ALL)
 
 if (NOT COMPILER_RT_STANDALONE_BUILD)
   # Compute the Clang version from the LLVM version.
@@ -219,7 +219,8 @@ pythonize_bool(COMPILER_RT_DEBUG)
 include(config-ix)
 
 if(COMPILER_RT_ENABLE_WERROR)
-  add_definitions(-Werror)
+  add_definitions_if(COMPILER_RT_HAS_WERROR_FLAG -Werror)
+  add_definitions_if(COMPILER_RT_HAS_WX_FLAG /WX)
 endif()
 
 # Provide some common commmandline flags for Sanitizer runtimes.

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake?rev=202023&r1=202022&r2=202023&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake Mon Feb 24 05:32:49 2014
@@ -47,3 +47,9 @@ macro(append_no_rtti_flag list)
   append_if(${list} COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti)
   append_if(${list} COMPILER_RT_HAS_GR_FLAG /GR-)
 endmacro()
+
+macro(add_definitions_if condition)
+  if(${condition})
+    add_definitions(${ARGN})
+  endif()
+endmacro()

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=202023&r1=202022&r2=202023&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Mon Feb 24 05:32:49 2014
@@ -24,6 +24,7 @@ check_cxx_compiler_flag(-g COMPILER_RT_H
 check_cxx_compiler_flag(/Zi COMPILER_RT_HAS_Zi_FLAG)
  
 # Warnings.
+check_cxx_compiler_flag(-Werror COMPILER_RT_HAS_WERROR_FLAG)
 check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG)
 check_cxx_compiler_flag("-Werror -Wglobal-constructors"   COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG)
 check_cxx_compiler_flag("-Werror -Wno-c99-extensions"     COMPILER_RT_HAS_WNO_C99_EXTENSIONS_FLAG)
@@ -31,4 +32,5 @@ check_cxx_compiler_flag("-Werror -Wno-gn
 check_cxx_compiler_flag("-Werror -Wno-non-virtual-dtor"   COMPILER_RT_HAS_WNO_NON_VIRTUAL_DTOR_FLAG)
 check_cxx_compiler_flag("-Werror -Wno-variadic-macros"    COMPILER_RT_HAS_WNO_VARIADIC_MACROS_FLAG)
 
+check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG)
 check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG)





More information about the llvm-commits mailing list