[llvm-commits] [llvm] r122648 - /llvm/trunk/cmake/modules/LLVMProcessSources.cmake

Oscar Fuentes ofv at wanadoo.es
Fri Dec 31 11:10:49 PST 2010


Author: ofv
Date: Fri Dec 31 13:10:49 2010
New Revision: 122648

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

Modified:
    llvm/trunk/cmake/modules/LLVMProcessSources.cmake

Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=122648&r1=122647&r2=122648&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Fri Dec 31 13:10:49 2010
@@ -42,7 +42,7 @@
     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 @@
     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()
 





More information about the llvm-commits mailing list