mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-04-19 07:21:12 +00:00
adjust cmake
This commit is contained in:
parent
e1fb240edc
commit
181fe41483
4 changed files with 13 additions and 2 deletions
|
@ -6,3 +6,4 @@ file(GLOB BASE_GAME_SRC "*.h" "*.c" "*.cpp")
|
|||
|
||||
add_library(base_game OBJECT ${BASE_GAME_SRC})
|
||||
target_compile_options(base_game PUBLIC -Wno-write-strings)
|
||||
set_property(TARGET base_game PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
|
|
@ -5,3 +5,4 @@ set(CMAKE_CXX_STANDARD 17)
|
|||
file(GLOB COMMON_SRC "*.h" "*.c" "*.cpp")
|
||||
|
||||
add_library(common OBJECT ${COMMON_SRC})
|
||||
set_property(TARGET common PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
|
|
@ -26,9 +26,17 @@ set(GAME_LIB_NAME "qagame${ARCH}")
|
|||
|
||||
file(GLOB_RECURSE GAME_SRC "*.h" "*.c" "*.cpp")
|
||||
|
||||
if(UNIX)
|
||||
set(GAME_LINKER_OPTION -lstdc++fs)
|
||||
endif(UNIX)
|
||||
|
||||
if(WIN32)
|
||||
set(GAME_LINKER_OPTION -static -static-libgcc -static-libstdc++ -lstdc++fs)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
add_library(${GAME_LIB_NAME} SHARED ${GAME_SRC} $<TARGET_OBJECTS:base_game>)
|
||||
target_link_libraries(${GAME_LIB_NAME})
|
||||
target_link_libraries(${GAME_LIB_NAME} ${GAME_LINKER_OPTION})
|
||||
target_include_directories(${GAME_LIB_NAME} PUBLIC ../lua/include ../json/include)
|
||||
target_compile_options(${GAME_LIB_NAME} PUBLIC -fpermissive)
|
||||
set_target_properties(${GAME_LIB_NAME} PROPERTIES PREFIX "")
|
||||
|
|
|
@ -23,7 +23,7 @@ else ()
|
|||
endif ()
|
||||
|
||||
if(UNIX)
|
||||
set(UI_LINKER_OPTIONS -static-libgcc -static-libstdc++ -lstdc++fs)
|
||||
set(UI_LINKER_OPTIONS -lstdc++fs)
|
||||
endif(UNIX)
|
||||
|
||||
if(WIN32)
|
||||
|
@ -40,4 +40,5 @@ target_link_libraries(${UI_LIB_NAME} ${UI_LINKER_OPTIONS})
|
|||
target_compile_options(${UI_LIB_NAME} PUBLIC -Wno-narrowing -Wno-write-strings)
|
||||
target_compile_definitions(${UI_LIB_NAME} PUBLIC -DUI_DLL)
|
||||
set_target_properties(${UI_LIB_NAME} PROPERTIES PREFIX "")
|
||||
set_property(TARGET ${UI_LIB_NAME} PROPERTY POSITION_INDEPENDENT_CODE OFF)
|
||||
target_compile_definitions(base_game PUBLIC -DUI_DLL)
|
Loading…
Reference in a new issue