-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (39 loc) · 1.53 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
cmake_minimum_required(VERSION 3.19)
option(USE_GLOBAL_VCPKG "Use the global Vcpkg " OFF)
option(USE_EMSCRIPTEN "Use Emscripten to build a WebAssembly module" OFF)
option(USE_CCACHE "Use ccache to speed up recompilation" ON)
if (USE_GLOBAL_VCPKG)
set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
else()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)
endif()
if (USE_EMSCRIPTEN)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE $ENV{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake CACHE STRING "Emscripten toolchain file")
set(VCPKG_TARGET_TRIPLET wasm32-emscripten)
message(STATUS "Built with Emscripten")
endif()
if(USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set(PATH_TO_CCACHE ccache)
else()
message(WARNING "Ccache path not found, disabling ccache")
endif(CCACHE_FOUND)
set(CXX_COMPILER_LAUNCHER PATH_TO_CCACHE)
endif()
project(AtmosphericEngine VERSION 0.1)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(!MSVC)
add_compile_options(-Werror=reorder-init-list)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory(AtmosphericEngine)
add_subdirectory(Example_MazeWorld)
add_subdirectory(Example_HelloWorld)
add_subdirectory(Example_Breakout2D)
add_subdirectory(Example_Terrain)