-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (44 loc) · 1.63 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
52
53
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 3.1)
project(Arrancar0)
option(USE_CLANG "build application with clang" ON) # ON is the default
if (USE_CLANG)
SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
SET (CMAKE_AR "/usr/bin/llvm-ar")
SET (CMAKE_LINKER "/usr/bin/llvm-ld")
SET (CMAKE_NM "/usr/bin/llvm-nm")
SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib")
endif (USE_CLANG)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release
RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# Specify output directories.
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin")
# Include custom macros to find SC2Api.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
# set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wthread-safety -fno-omit-frame-pointer -fsanitize=all")
# set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -Wthread-safety -fno-omit-frame-pointer -fsanitize=all")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
find_package(SC2Api REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(GLog REQUIRED)
find_package(GTest REQUIRED)
# Build with c++14 support, required by sc2api.
set(CMAKE_CXX_STANDARD 17)
add_subdirectory("src")
option(ENABLE_TESTS "Build tests" ON)
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
# Futile test
# add_custom_command(
# OUTPUT compile_commands.json
# COMMAND ${CMAKE_COMMAND} -E copy
# ${CMAKE_SOURCE_DIR}/build/compile_commands.json
# ${CMAKE_SOURCE_DIR}
# DEPENDS compile_commands.json
# )