summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2010-12-31 19:10:49 +0000
committerOscar Fuentes <ofv@wanadoo.es>2010-12-31 19:10:49 +0000
commit023c63351ec78d88c1b3bd600cbcab56838769ae (patch)
tree767334a8dbefc784812fdc9d46bda0d37a2d4fb2 /cmake
parent8a3d29cf1064e8efbb8c8d5d4653ad147c7b037e (diff)
downloadllvm-023c63351ec78d88c1b3bd600cbcab56838769ae.tar.gz
llvm-023c63351ec78d88c1b3bd600cbcab56838769ae.tar.bz2
llvm-023c63351ec78d88c1b3bd600cbcab56838769ae.tar.xz
CMake (MSVC): cmake automatically adds the /EHsc and /GR compiler
options. If we are building with exceptions/rtti disabled, we replace /EHsc with /EHs-c- and /GR with /GR-, respectively. If we just add the disabling options we get warnings like this: cl : Command line warning D9025 : overriding '/EHs' with '/EHs-' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/LLVMProcessSources.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake
index 7bfca207f6..d9c14fbe83 100644
--- a/cmake/modules/LLVMProcessSources.cmake
+++ b/cmake/modules/LLVMProcessSources.cmake
@@ -42,7 +42,7 @@ function(llvm_process_sources OUT_VAR)
if( CMAKE_COMPILER_IS_GNUCXX )
add_definitions( -fno-exceptions )
elseif( MSVC )
- add_definitions( /EHs-c- )
+ string( REGEX REPLACE "[ ^]/EHsc ?" " /EHs-c- " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
add_definitions( /D_HAS_EXCEPTIONS=0 )
endif()
endif()
@@ -50,7 +50,7 @@ function(llvm_process_sources OUT_VAR)
if( CMAKE_COMPILER_IS_GNUCXX )
add_definitions( -fno-rtti )
elseif( MSVC )
- add_definitions( /GR- )
+ string( REGEX REPLACE "[ ^]/GR ?" " /GR- " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
endif()
endif()