-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
46 lines (28 loc) · 1.48 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
# This is the root LunaPaak build file.
# It lists all the libraries and then uses them to build the main executable
cmake_minimum_required(VERSION 3.0)
project(LunaPaak C CXX)
# TODO: Check if libraries are present (as submodules)
if (MSVC)
# Make build use multiple threads:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
# Make release builds use link-time code generation:
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
# Use static CRT:
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
endif()
add_definitions(-DLUA_COMPAT_MODULE)
add_subdirectory (lib EXCLUDE_FROM_ALL)
enable_testing()
add_subdirectory (src)
# Want to build some modules as dynamic, not for this project, but for others to use:
set_target_properties(LuaSimpleWinHttp PROPERTIES EXCLUDE_FROM_ALL false)
set_target_properties(LuaSha1 PROPERTIES EXCLUDE_FROM_ALL false)