-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
33 lines (23 loc) · 1.11 KB
/
CMakeLists.txt
File metadata and controls
33 lines (23 loc) · 1.11 KB
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
cmake_minimum_required(VERSION 3.2...3.25)
project(sjson-cpp_unit_tests CXX)
# Project root is <sjson-cpp-dir>\tests\main_android
set(PROJECT_ROOT_DIR "${PROJECT_SOURCE_DIR}/../../../..")
include_directories("${PROJECT_ROOT_DIR}/../../includes")
include_directories("${PROJECT_ROOT_DIR}/../../external/catch2/single_include")
include_directories("${PROJECT_ROOT_DIR}/../sources")
# Grab all of our test source files
file(GLOB_RECURSE ALL_TEST_SOURCE_FILES LIST_DIRECTORIES false
${PROJECT_ROOT_DIR}/../sources/*.h
${PROJECT_ROOT_DIR}/../sources/*.cpp)
# Grab all of our main source files
file(GLOB_RECURSE ALL_MAIN_SOURCE_FILES LIST_DIRECTORIES false
${PROJECT_SOURCE_DIR}/*.cpp)
add_library(${PROJECT_NAME} SHARED ${ALL_TEST_SOURCE_FILES} ${ALL_MAIN_SOURCE_FILES})
# Enable exceptions
target_compile_options(${PROJECT_NAME} PRIVATE -fexceptions)
# Enable debug symbols
target_compile_options(${PROJECT_NAME} PRIVATE -g)
# Throw on failure to allow us to catch them and recover
add_definitions(-DSJSON_CPP_ON_ASSERT_THROW)
target_include_directories(${PROJECT_NAME} PUBLIC jni)
target_link_libraries(${PROJECT_NAME} m log)