OSX .dylib's do not get a CPU suffix

This commit is contained in:
dhewg 2011-12-31 18:39:31 +01:00
parent bf1f05bd87
commit d4ec9cc87f

View file

@ -55,6 +55,9 @@ if (cpu STREQUAL "x86_64" AND X86)
set(cpu "x86")
endif()
# game library suffix
set(gamesuffix ${cpu})
# target os
if (APPLE)
set(os "macosx")
@ -142,6 +145,9 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
endif()
if (APPLE)
# no suffix for .dylib
set(gamesuffix "")
add_definitions(-DMACOS_X=1)
if (cpu STREQUAL "x86_64")
@ -717,21 +723,21 @@ if (DEDICATED)
endif()
if (GAME)
add_library(game${cpu} SHARED ${src_game})
set_target_properties(game${cpu} PROPERTIES PREFIX "")
set_target_properties(game${cpu} PROPERTIES COMPILE_DEFINITIONS "GAME_DLL")
set_target_properties(game${cpu} PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/game")
set_target_properties(game${cpu} PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(game${cpu} PROPERTIES INSTALL_NAME_DIR "@executable_path")
target_link_libraries(game${cpu} idlib)
add_library(game${gamesuffix} SHARED ${src_game})
set_target_properties(game${gamesuffix} PROPERTIES PREFIX "")
set_target_properties(game${gamesuffix} PROPERTIES COMPILE_DEFINITIONS "GAME_DLL")
set_target_properties(game${gamesuffix} PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/game")
set_target_properties(game${gamesuffix} PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(game${gamesuffix} PROPERTIES INSTALL_NAME_DIR "@executable_path")
target_link_libraries(game${gamesuffix} idlib)
endif()
if (D3XP)
add_library(d3xp${cpu} SHARED ${src_d3xp})
set_target_properties(d3xp${cpu} PROPERTIES PREFIX "")
set_target_properties(d3xp${cpu} PROPERTIES COMPILE_DEFINITIONS "GAME_DLL;_D3XP;CTF")
set_target_properties(d3xp${cpu} PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/d3xp")
set_target_properties(d3xp${cpu} PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(d3xp${cpu} PROPERTIES INSTALL_NAME_DIR "@executable_path")
target_link_libraries(d3xp${cpu} idlib)
add_library(d3xp${gamesuffix} SHARED ${src_d3xp})
set_target_properties(d3xp${gamesuffix} PROPERTIES PREFIX "")
set_target_properties(d3xp${gamesuffix} PROPERTIES COMPILE_DEFINITIONS "GAME_DLL;_D3XP;CTF")
set_target_properties(d3xp${gamesuffix} PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/d3xp")
set_target_properties(d3xp${gamesuffix} PROPERTIES LINK_FLAGS "${ldflags}")
set_target_properties(d3xp${gamesuffix} PROPERTIES INSTALL_NAME_DIR "@executable_path")
target_link_libraries(d3xp${gamesuffix} idlib)
endif()