-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
51 lines (42 loc) · 1.24 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.13)
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_CXX_STANDARD 17)
if (UNIX)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
endif()
project(TechTree)
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
set(IS_RELEASE TRUE)
endif()
if (IS_RELEASE)
include(CheckIPOSupported)
check_ipo_supported(RESULT ENABLE_LTO OUTPUT error)
if (NOT MSVC)
add_link_options(-s)
endif()
endif()
if(CMAKE_GENERATOR MATCHES "Ninja")
add_compile_options(-fdiagnostics-color)
endif()
add_compile_definitions(WINVER=0x0501)
add_compile_definitions(NOMINMAX)
add_compile_definitions(WIN32_LEAN_AND_MEAN)
if(MSVC)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
else()
add_compile_options(-fno-exceptions)
if (IS_RELEASE)
add_link_options(-Wl,--exclude-all-symbols)
endif()
add_link_options(-static-libstdc++ -static-libgcc)
add_definitions(-Wall -Wsign-compare)
endif()
add_subdirectory(TechTree)
add_subdirectory(AoETechTree)