summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-02-18 07:52:40 +0000
committerAlexey Samsonov <samsonov@google.com>2014-02-18 07:52:40 +0000
commit0571186b725b1bbd13d80ccbf9400d7d4c5b3593 (patch)
tree064829a3906068d58e823f0d11170d7749488800 /cmake/Modules/CompilerRTUtils.cmake
parent7b72272d3a2f635c9d75ee46817d35a6d65afcd8 (diff)
[CMake] Simplify setting compile flag disabling RTTI
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index fce37e3eb..fc1da8545 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -36,3 +36,14 @@ macro(pythonize_bool var)
set(${var}_PYBOOL False)
endif()
endmacro()
+
+macro(append_if list condition var)
+ if (${condition})
+ list(APPEND ${list} ${var})
+ endif()
+endmacro()
+
+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()