Drop the CPU suffix from libraries on all platforms

This commit is contained in:
dhewg 2012-07-03 18:26:24 +02:00
parent ff00686218
commit 262df52cdd
2 changed files with 17 additions and 23 deletions

View file

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

View file

@ -99,11 +99,11 @@ void idSysLocal::DLL_Unload( uintptr_t dllHandle ) {
void idSysLocal::DLL_GetFileName( const char *baseName, char *dllName, int maxLength ) { void idSysLocal::DLL_GetFileName( const char *baseName, char *dllName, int maxLength ) {
#ifdef _WIN32 #ifdef _WIN32
idStr::snPrintf( dllName, maxLength, "%s" BUILD_CPU ".dll", baseName ); idStr::snPrintf( dllName, maxLength, "%s.dll", baseName );
#elif defined( __unix__ ) #elif defined( __unix__ )
idStr::snPrintf( dllName, maxLength, "%s" BUILD_CPU ".so", baseName ); idStr::snPrintf( dllName, maxLength, "%s.so", baseName );
#elif defined( MACOS_X ) #elif defined( MACOS_X )
idStr::snPrintf( dllName, maxLength, "%s" ".dylib", baseName ); idStr::snPrintf( dllName, maxLength, "%s.dylib", baseName );
#else #else
#error OS define is required #error OS define is required
#endif #endif