-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (41 loc) · 1.74 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")
# set the project name
project(egg2021)
message("Now building on:${CMAKE_SYSTEM_NAME}")
OPTION(LOCAL "local test mode" ON)
if(LOCAL)
message("local test mode is on!")
add_definitions(-DLOCAL=1)
endif()
# strange bug on windows
# if(CMAKE_SYSTEM_NAME MATCHES "Windows")
# set(unofficial-box2d_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tools/vcpkg/installed/x64-windows/share/unofficial-box2d")
# endif(CMAKE_SYSTEM_NAME MATCHES "Windows")
# specify the C++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS True)
# turn off asan on CI
if(NOT DEFINED ENV{CI})
message("ASan enabled")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
else()
message("Building on CI, ASan disabled")
endif()
# Typically you don't care so much for a third party library's tests to be
# run from your own project's code.
set(JSON_BuildTests OFF CACHE INTERNAL "")
# json lib
add_subdirectory(include/json)
include_directories(include/json/include)
include_directories(include/record-sdk/)
file(GLOB SOURCES "*.cpp" "include/record-sdk/cpp_record_sdk/entities.cpp" "include/record-sdk/cpp_record_sdk/record.cpp")
# add the executable
add_executable(main ${SOURCES})
target_include_directories(main PRIVATE include/cpp_record_sdk)
find_package(unofficial-box2d CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::box2d::box2d)
target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json)