mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Fixed gamespy compilation error on unix
This commit is contained in:
parent
7f5fcd410e
commit
296e0c271b
2 changed files with 18 additions and 19 deletions
|
@ -145,6 +145,9 @@ set(SOURCES_COMMON
|
|||
"code/sys/sys_main.c"
|
||||
"code/sys/sys_autoupdater.c"
|
||||
"code/sys/con_log.c"
|
||||
# Gamespy
|
||||
"code/gamespy/sv_gamespy.c"
|
||||
"code/gamespy/sv_gqueryreporting.c"
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE SOURCES_SKEL "code/tiki/*.cpp" "code/skeletor/*.cpp")
|
||||
|
@ -168,15 +171,17 @@ set(SOURCES_SERVER_APP ${SOURCES_APP} ${SOURCES_SERVER})
|
|||
add_executable(omohaaded ${SOURCES_SERVER_APP} ${SOURCES_PLATFORM_SPECIFIC} "code/null/null_client.c" "code/null/null_input.c" "code/null/null_snddma.c")
|
||||
target_compile_definitions(omohaaded PRIVATE NO_SCRIPTENGINE DEDICATED TARGET_GAME_TYPE=${TARGET_GAME_TYPE})
|
||||
target_compile_features(omohaaded PUBLIC cxx_std_17)
|
||||
target_link_libraries(omohaaded gcd)
|
||||
# Gamespy dependency
|
||||
add_dependencies(omohaaded gcd)
|
||||
target_link_libraries(omohaaded PRIVATE gcd)
|
||||
target_include_directories(omohaaded PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/SDL2/include")
|
||||
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(omohaaded wsock32 ws2_32)
|
||||
target_link_libraries(omohaaded winmm)
|
||||
target_link_libraries(omohaaded PRIVATE wsock32 ws2_32)
|
||||
target_link_libraries(omohaaded PRIVATE winmm)
|
||||
elseif(UNIX)
|
||||
target_link_libraries(omohaaded ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(omohaaded PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
INSTALL(TARGETS omohaaded DESTINATION "./")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.1)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(gcd)
|
||||
|
||||
|
@ -8,20 +8,13 @@ include_directories("${CURRENT_DIR}/common")
|
|||
include_directories("${CURRENT_DIR}/gcdkey")
|
||||
|
||||
file(GLOB SRCS_common
|
||||
"${CURRENT_DIR}/*.c"
|
||||
"${CURRENT_DIR}/common/*.c"
|
||||
"${CURRENT_DIR}/common/*.c"
|
||||
"${CURRENT_DIR}/darray.c"
|
||||
"${CURRENT_DIR}/hashtable.c"
|
||||
"${CURRENT_DIR}/md5c.c"
|
||||
"${CURRENT_DIR}/gutil.c"
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
file(GLOB SRCS_platform "${CURRENT_DIR}/common/linux/*.c")
|
||||
elseif(WIN32)
|
||||
file(GLOB SRCS_platform "${CURRENT_DIR}/common/win32/*.c")
|
||||
elseif(APPLE)
|
||||
file(GLOB SRCS_platform "${CURRENT_DIR}/common/macosx/*.c")
|
||||
endif()
|
||||
|
||||
SET(SRCS_common ${SRCS_common} ${SRCS_platform})
|
||||
|
||||
file(GLOB SRCS_gcdkey
|
||||
"${CURRENT_DIR}/gcdkey/*.c"
|
||||
)
|
||||
|
@ -91,7 +84,6 @@ if(UNIX)
|
|||
endif(UNIX)
|
||||
|
||||
set(DEPENDENT_LIBS
|
||||
gcd_common
|
||||
gcd_key
|
||||
gcd_gp
|
||||
gcd_gstats
|
||||
|
@ -108,8 +100,10 @@ set(DEPENDENT_LIBS
|
|||
target_link_libraries(gcd INTERFACE ${DEPENDENT_LIBS})
|
||||
|
||||
foreach(LIB ${DEPENDENT_LIBS})
|
||||
target_link_libraries(${LIB} PUBLIC gcd)
|
||||
target_link_libraries(${LIB} PUBLIC gcd_common)
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(gcd_qr2 PRIVATE gcd_natneg)
|
||||
|
||||
#target_compile_definitions(gcd PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
#set_property(TARGET gcd PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue