Skip to content

Commit

Permalink
general: separated platform-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSimek committed Oct 2, 2012
1 parent ead8b95 commit 634ef2d
Show file tree
Hide file tree
Showing 5 changed files with 1,708 additions and 1,674 deletions.
29 changes: 18 additions & 11 deletions CMakeLists.txt
Expand Up @@ -120,26 +120,34 @@ endif(NOT CMAKE_SYSTEM MATCHES "Darwin")
FILE(GLOB COMMON_SRC
"src/qcommon/*.c"
)
if(CMAKE_SYSTEM MATCHES "Darwin")
LIST(APPEND COMMON_SRC "src/sys/sys_osx.m")
SET_SOURCE_FILES_PROPERTIES("src/sys/sys_osx.m" PROPERTIES LANGUAGE C)
endif()

FILE(GLOB COMMON_SRC_REMOVE
"src/qcommon/dl_main_curl.c"
"src/qcommon/dl_main_stubs.c"
"src/botlib/botlib_stub.c"
)
LIST(REMOVE_ITEM COMMON_SRC ${COMMON_SRC_REMOVE})

# Platform specific code for server and client
if(UNIX)
if(CMAKE_SYSTEM MATCHES "Darwin")
LIST(APPEND PLATFORM_SRC "src/sys/sys_osx.m")
SET_SOURCE_FILES_PROPERTIES("src/sys/sys_osx.m" PROPERTIES LANGUAGE C)
endif(CMAKE_SYSTEM MATCHES "Darwin")

LIST(APPEND PLATFORM_SRC "src/sys/sys_unix.c")
LIST(APPEND PLATFORM_SRC "src/sys/con_tty.c")
elseif(WIN32)
LIST(APPEND PLATFORM_SRC "src/sys/sys_win32.c")
LIST(APPEND PLATFORM_SRC "src/sys/con_win32.c")
endif()

FILE(GLOB SERVER_SRC
"src/server/*.c"
"src/null/*.c"
"src/botlib/be*.c"
"src/botlib/l_*.c"
"src/sys/sys_*.c"
"src/sys/sys_main.c"
"src/sys/con_log.c"
"src/sys/con_tty.c"
"src/qcommon/dl_main_stubs.c"
)

Expand All @@ -148,9 +156,8 @@ FILE(GLOB CLIENT_SRC
"src/client/*.c"
"src/botlib/be*.c"
"src/botlib/l_*.c"
"src/sys/sys_*.c"
"src/sys/sys_main.c"
"src/sys/con_log.c"
"src/sys/con_tty.c"
"src/renderer/*.c"
"src/sdl/*.c"
)
Expand Down Expand Up @@ -265,7 +272,7 @@ endif(TRACKBASE_SUPPORT)
# Build
#-----------------------------------------------------------------
if(BUILD_CLIENT)
add_executable(etl ${COMMON_SRC} ${CLIENT_SRC})
add_executable(etl ${COMMON_SRC} ${CLIENT_SRC} ${PLATFORM_SRC})
include_directories(
${OPENGL_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIRS}
Expand Down Expand Up @@ -303,7 +310,7 @@ if(BUILD_CLIENT)
endif(BUILD_CLIENT)

if(BUILD_SERVER)
add_executable(etlded ${COMMON_SRC} ${SERVER_SRC})
add_executable(etlded ${COMMON_SRC} ${SERVER_SRC} ${PLATFORM_SRC})
target_link_libraries(etlded ${OS_LIBRARIES})
set_target_properties(etlded
PROPERTIES COMPILE_DEFINITIONS "DEDICATED")
Expand Down

0 comments on commit 634ef2d

Please sign in to comment.