[llvm-commits] [llvm] r131181 - in /llvm/trunk: cmake/modules/HandleLLVMOptions.cmake cmake/modules/LLVMProcessSources.cmake unittests/CMakeLists.txt
Oscar Fuentes
ofv at wanadoo.es
Wed May 11 06:53:08 PDT 2011
Author: ofv
Date: Wed May 11 08:53:08 2011
New Revision: 131181
URL: http://llvm.org/viewvc/llvm-project?rev=131181&view=rev
Log:
Handle gcc-compatible compilers (such as clang) the same way we handle
gcc.
Fixes PR9886.
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
llvm/trunk/cmake/modules/LLVMProcessSources.cmake
llvm/trunk/unittests/CMakeLists.txt
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=131181&r1=131180&r2=131181&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed May 11 08:53:08 2011
@@ -1,5 +1,11 @@
include(AddLLVMDefinitions)
+if( CMAKE_COMPILER_IS_GNUCXX )
+ set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
+elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+ set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
+endif()
+
# Run-time build mode; It is used for unittests.
if(MSVC_IDE)
# Expect "$(Configuration)", "$(OutDir)", etc.
@@ -167,7 +173,7 @@
if (LLVM_ENABLE_WERROR)
add_llvm_definitions( /WX )
endif (LLVM_ENABLE_WERROR)
-elseif( CMAKE_COMPILER_IS_GNUCXX )
+elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
if (LLVM_ENABLE_WARNINGS)
add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings )
if (LLVM_ENABLE_PEDANTIC)
Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=131181&r1=131180&r2=131181&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Wed May 11 08:53:08 2011
@@ -56,7 +56,7 @@
# Set common compiler options:
if( NOT LLVM_REQUIRES_EH )
- if( CMAKE_COMPILER_IS_GNUCXX )
+ if( LLVM_COMPILER_IS_GCC_COMPATIBLE )
add_definitions( -fno-exceptions )
elseif( MSVC )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/EHsc" "/EHs-c-")
@@ -64,7 +64,7 @@
endif()
endif()
if( NOT LLVM_REQUIRES_RTTI )
- if( CMAKE_COMPILER_IS_GNUCXX )
+ if( LLVM_COMPILER_IS_GCC_COMPATIBLE )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "-frtti" "-fno-rtti")
elseif( MSVC )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/GR" "/GR-")
Modified: llvm/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=131181&r1=131180&r2=131181&view=diff
==============================================================================
--- llvm/trunk/unittests/CMakeLists.txt (original)
+++ llvm/trunk/unittests/CMakeLists.txt Wed May 11 08:53:08 2011
@@ -20,7 +20,7 @@
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
add_definitions(-DGTEST_HAS_RTTI=0)
-if( CMAKE_COMPILER_IS_GNUCXX )
+if( LLVM_COMPILER_IS_GCC_COMPATIBLE )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "-frtti" "-fno-rtti")
elseif( MSVC )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/GR" "/GR-")
More information about the llvm-commits
mailing list