-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
83 lines (61 loc) · 1.87 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
include_guard()
cmake_minimum_required(VERSION 3.21)
# General info about the project
project(ZeroMate
VERSION 1.4.2
DESCRIPTION "Raspberry Pi Zero emulator"
HOMEPAGE_URL "https://github.com/silhavyj/ZeroMate"
LANGUAGES C CXX
)
# Enable parallel build
set(CMAKE_BUILD_PARALLEL_LEVEL 4)
# Default version of C++ is set to 20
set(CMAKE_CXX_STANDARD 20)
# Standard project settings
include(cmake/standard_project_settings.cmake)
add_library(project_warnings INTERFACE)
add_library(project_options INTERFACE)
target_compile_features(project_options
INTERFACE
cxx_std_${CMAKE_CXX_STANDARD}
)
# Standard compiler warnings
include(cmake/compiler_warnings.cmake)
set_project_warnings(project_warnings)
# Add sanitizer options if supported by the compiler
include(cmake/sanitizers.cmake)
enable_sanitizers(project_options)
# Turn on compiler optimizations for the Release build
if (CMAKE_BUILD_TYPE STREQUAL "Release")
include(cmake/compiler_optimizations.cmake)
set_project_optimizations(project_warnings)
endif ()
# Allow for static analysis option
include(cmake/static_analyzers.cmake)
# Add submodules (libraries)
add_subdirectory(external/fmt)
add_subdirectory(external/elfio)
add_subdirectory(external/glew)
add_subdirectory(external/glfw)
add_subdirectory(external/magic_enum)
add_subdirectory(external/capstone)
# Add the external subdirectory (manual build from the source)
add_subdirectory(external)
# Add the project libraries folder
add_subdirectory(lib)
# Add the peripherals subdirectory
add_subdirectory(peripherals)
# Add the src folder
add_subdirectory(src)
# Add tests
option(ENABLE_TESTING "Enable Test Builds" ON)
if (ENABLE_TESTING)
add_subdirectory(external/googletest)
enable_testing()
add_subdirectory(test)
endif ()
# Generate docs
option(BUILD_DOC "Build Documentation" ON)
if (BUILD_DOC)
include(cmake/doxygen.cmake)
endif ()