-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
53 lines (41 loc) · 1.42 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.23)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(little-engine VERSION 0.2.0)
set(is_root_project OFF)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(is_root_project ON)
endif()
option(LE_PCH "Use PCH for little" ON)
option(LE_BUILD_SCENE "Build little-engine scene library" ON)
option(LE_BUILD_TOOLS "Build little-engine tools" ${is_root_project})
option(LE_USE_FREETYPE "Use Freetype as the font backend" ON)
option(LE_BUILD_EXAMPLE "Build little-engine example" ${is_root_project})
option(LE_BUILD_TESTS "Build little-engine tests" ${is_root_project})
add_library(le-compile-options INTERFACE)
add_library(le::le-compile-options ALIAS le-compile-options)
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
target_compile_options(le-compile-options INTERFACE
-Wall -Wextra -Wpedantic -Wconversion -Wunused -Werror=return-type $<$<NOT:$<CONFIG:Debug>>:-Werror>
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
target_compile_options(le-compile-options INTERFACE
$<$<NOT:$<CONFIG:Debug>>:/WX>
)
endif()
add_subdirectory(ext)
add_subdirectory(engine)
if(LE_BUILD_SCENE)
add_subdirectory(scene)
endif()
if(LE_BUILD_TOOLS)
add_subdirectory(tools)
endif()
if(LE_BUILD_EXAMPLE)
add_subdirectory(example)
endif()
if(LE_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()