-
Notifications
You must be signed in to change notification settings - Fork 360
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (38 loc) · 1.07 KB
/
CMakeLists.txt
File metadata and controls
49 lines (38 loc) · 1.07 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.10)
project(LuaBridge)
include(CMakeDependentOption)
option(LUABRIDGE_CXX17 "Use C++17 standard if supported by compiler" OFF)
if(LUABRIDGE_CXX17)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
cmake_dependent_option(LUABRIDGE_TESTING "Build tests" ON
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)
if(MSVC)
add_compile_options(/MP)
endif()
add_subdirectory(Source)
if(LUABRIDGE_SANITIZE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
if(LUABRIDGE_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "Use /MD and /MDd" FORCE)
add_subdirectory(third_party/gtest EXCLUDE_FROM_ALL)
add_library(GTest::gtest ALIAS gtest)
enable_testing()
add_subdirectory(Tests)
endif()
add_custom_target(Documentation SOURCES
.clang-format
.github/workflows/cmake.yml
CHANGES.md
README.md
Doxyfile
index.html
Manual.html
)