mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 21:00:29 +00:00
Handle gcc-compatible compilers (such as clang) the same way we handle
gcc. Fixes PR9886. llvm-svn: 131181
This commit is contained in:
parent
2a654a69ed
commit
51417218c2
@ -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( MSVC )
|
||||
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)
|
||||
|
@ -56,7 +56,7 @@ function(llvm_process_sources OUT_VAR)
|
||||
|
||||
# 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 @@ function(llvm_process_sources OUT_VAR)
|
||||
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-")
|
||||
|
@ -20,7 +20,7 @@ set_target_properties(UnitTests PROPERTIES FOLDER "Tests")
|
||||
|
||||
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-")
|
||||
|
Loading…
Reference in New Issue
Block a user