cmake: fixed up to handle Clang and AppleClang

This commit is contained in:
Alam Ed Arias 2016-02-05 21:49:24 -05:00
parent 4d5f16330a
commit 864baeda05
2 changed files with 7 additions and 7 deletions

View file

@ -166,7 +166,7 @@ set(SRB2_CORE_GAME_SOURCES
p_tick.h
)
if(NOT CLANG)
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(SRB2_CORE_SOURCES ${SRB2_CORE_SOURCES} string.c)
endif()
@ -404,7 +404,7 @@ endif()
# Compatibility flag with later versions of GCC
# We should really fix our code to not need this
if(NOT CLANG AND NOT MSVC)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -mno-ms-bitfields)
endif()

View file

@ -117,7 +117,7 @@ if(${SDL2_FOUND})
add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES})
set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME})
if(CLANG)
if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
add_framework(CoreFoundation SRB2SDL2)
add_framework(SDL2 SRB2SDL2)
add_framework(SDL2_mixer SRB2SDL2)
@ -224,7 +224,7 @@ if(${SDL2_FOUND})
endif()
#### Installation ####
if (CLANG)
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
install(TARGETS SRB2SDL2
BUNDLE DESTINATION .
)
@ -265,7 +265,7 @@ if(${SDL2_FOUND})
# Mac bundle fixup
if(CLANG)
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
install(CODE "
include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\"