-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
69 lines (58 loc) · 2.57 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
62
63
64
65
66
67
68
69
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there")
endif ()
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE on)
if (UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
file(STRINGS "VERSION.md" VERSION_NB)
add_compile_definitions(LOGURU_WITH_FILEABS=1)
project(antara-gaming-sdk
VERSION ${VERSION_NB}
DESCRIPTION "Blockchain gaming sdk")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)")
endif ()
endif ()
endif ()
option(ANTARA_USE_VCPKG "Enable to use VCPKG for find dependencies" OFF)
option(ANTARA_BUILD_DOCS "Enable to build the documentation" OFF)
option(USE_SFML_ANTARA_WRAPPER "Use SFML antara wrapper" OFF)
option(USE_GLFW_ANTARA_WRAPPER "Use GLFW antara wrapper" OFF)
option(USE_SDL_ANTARA_WRAPPER "Use SDL antara wrapper" OFF)
option(USE_LUA_ANTARA_WRAPPER "Use LUA antara wrapper" OFF)
option(USE_BOX2D_ANTARA_WRAPPER "Use Box2D antara wrapper" OFF)
option(USE_IMGUI_ANTARA_WRAPPER "Use Imgui antara wrapper" OFF)
option(ENABLE_BLOCKCHAIN_MODULES "Enable the usage of blockchain modules (additional dependencies)" OFF)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(antara)
init_antara_env()
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/modules/core/antara/gaming/core/version.hpp)
configure_file(${CMAKE_MODULE_PATH}/version.hpp.in ${PROJECT_SOURCE_DIR}/modules/core/antara/gaming/core/version.hpp @ONLY)
endif ()
option(USE_ASAN "Use address sanitizer" OFF)
option(USE_TSAN "Use thread sanitizer" OFF)
option(USE_UBSAN "Use thread sanitizer" OFF)
option(ENABLE_COVERAGE "Enable coverage" OFF)
option(ANTARA_BUILD_EXAMPLES "Build project example" OFF)
option(ANTARA_BUILD_UNIT_TESTS "Enable the Build of unit tests" OFF)
if (LINUX)
option(BUILD_WITH_APPIMAGE "Build with appimage" OFF)
endif ()
if (EMSCRIPTEN)
option(ENABLE_HTML_COMPILATION "Enable web html compilation" OFF)
endif ()
option(COVERAGE_CLION_TOOLS "Enable Clion internal coverage tools" OFF)
add_subdirectory(modules)
if (ANTARA_BUILD_EXAMPLES)
add_subdirectory(messy_playground)
endif ()
if (ANTARA_BUILD_DOCS)
add_subdirectory(docs)
endif ()