- added Edward-san's patch for allowing 'clang' compiler to use the same 'gcc' cmake settings
This commit is contained in:
parent
aa5f223051
commit
7c81c2f1ee
9 changed files with 28 additions and 28 deletions
|
|
@ -10,14 +10,14 @@ include( CheckCXXCompilerFlag )
|
|||
include( FindPkgConfig )
|
||||
|
||||
option( NO_ASM "Disable assembly code" )
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
option( NO_STRIP "Do not strip Release or MinSizeRel builds" )
|
||||
# At least some versions of Xcode fail if you strip with the linker
|
||||
# instead of the separate strip utility.
|
||||
if( APPLE )
|
||||
set( NO_STRIP ON )
|
||||
endif( APPLE )
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
|
||||
option( DYN_FLUIDSYNTH "Dynamically load fluidsynth" )
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ endif( SSE_MATTERS )
|
|||
|
||||
# Set up flags for GCC
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
if( PROFILE )
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg" )
|
||||
|
|
@ -420,7 +420,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
|
|||
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s" )
|
||||
set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -s" )
|
||||
endif( NOT NO_STRIP )
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
|
||||
# Check for functions that may or may not exist.
|
||||
|
||||
|
|
@ -529,15 +529,15 @@ if( WIN32 )
|
|||
win32/i_system.cpp
|
||||
win32/st_start.cpp
|
||||
win32/win32video.cpp )
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
# CMake is not set up to compile and link rc files with GCC. :(
|
||||
add_custom_command( OUTPUT zdoom-rc.o
|
||||
COMMAND windres -o zdoom-rc.o -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zdoom.rc
|
||||
DEPENDS win32/zdoom.rc )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} zdoom-rc.o )
|
||||
else( CMAKE_COMPILER_IS_GNUCXX )
|
||||
else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} win32/zdoom.rc )
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
else( WIN32 )
|
||||
set( SYSTEM_SOURCES_DIR sdl )
|
||||
set( SYSTEM_SOURCES
|
||||
|
|
@ -980,7 +980,7 @@ if( NOT WIN32 )
|
|||
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make
|
||||
COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make )
|
||||
endif( NOT WIN32 )
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
# GCC misoptimizes this file
|
||||
set_source_files_properties( oplsynth/fmopl.cpp PROPERTIES COMPILE_FLAGS "-fno-tree-dominator-opts -fno-tree-fre" )
|
||||
|
||||
|
|
@ -988,7 +988,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
|
|||
if( SSE_MATTERS )
|
||||
set_source_files_properties( x86.cpp PROPERTIES COMPILE_FLAGS "-msse2 -mmmx" )
|
||||
endif( SSE_MATTERS )
|
||||
endif( CMAKE_COMPILER_IS_GNUCXX )
|
||||
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
|
||||
if( MSVC )
|
||||
set_target_properties(zdoom PROPERTIES LINK_FLAGS "/MANIFEST:NO")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue