summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-13 11:31:10 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-13 11:31:10 +0000
commit561adf2d64fb56102ce45264f3693bf98e09bcea (patch)
tree4ce8ae02ef623340233f57317d1796984740190d /cmake
parent01e245e016702a57492be80cdbaff96c7ea955e1 (diff)
[CMake] Use /W3 instead of -Wall on Windows. Remove add_definitions abuse.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake15
-rw-r--r--cmake/config-ix.cmake1
2 files changed, 10 insertions, 6 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index b8eef90bb..e22e77535 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -46,13 +46,16 @@ macro(append_if condition value)
endif()
endmacro()
+# Appends value to all strings in ARGN, if the condition is true.
+macro(append_string_if condition value)
+ if(${condition})
+ foreach(str ${ARGN})
+ set(${str} "${${str}} ${value}")
+ endforeach()
+ endif()
+endmacro()
+
macro(append_no_rtti_flag list)
append_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list})
append_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list})
endmacro()
-
-macro(add_definitions_if condition)
- if(${condition})
- add_definitions(${ARGN})
- endif()
-endmacro()
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index a4d5827e1..09911db7b 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -35,6 +35,7 @@ check_cxx_compiler_flag("-Werror -Wno-gnu" COMPILER_RT_HAS_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(/W3 COMPILER_RT_HAS_W3_FLAG)
check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG)
check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG)