2019-02-15 23:51:24 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2019-02-15 23:49:31 +00:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
|
|
|
set(ARCH "x86_64")
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
|
|
|
|
set(ARCH "x86_64")
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
|
|
|
|
if (CMAKE_CL_64)
|
|
|
|
set(ARCH "x86_64")
|
|
|
|
else ()
|
|
|
|
set(ARCH "x86")
|
|
|
|
endif ()
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
|
|
|
|
set(ARCH "x86")
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
|
|
|
set(ARCH "x86")
|
|
|
|
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
|
|
|
|
set(ARCH "x86")
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set(UI_LIB_NAME "ui${ARCH}")
|
|
|
|
|
|
|
|
file(GLOB_RECURSE UI_SRC "*.h" "*.c" "*.cpp")
|
|
|
|
|
2019-02-22 21:14:19 +00:00
|
|
|
add_library(${UI_LIB_NAME} SHARED ${UI_SRC} $<TARGET_OBJECTS:common> $<TARGET_OBJECTS:base_game>)
|
2019-02-15 23:49:31 +00:00
|
|
|
target_include_directories(${UI_LIB_NAME} PUBLIC ../json/include ..)
|
2019-02-22 21:14:19 +00:00
|
|
|
target_link_libraries(${UI_LIB_NAME} -static -lstdc++fs)
|
2019-02-15 23:49:31 +00:00
|
|
|
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 "")
|
|
|
|
|
|
|
|
target_compile_definitions(base_game PUBLIC -DUI_DLL)
|