-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathCMakeLists.txt
64 lines (40 loc) · 1.79 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
cmake_minimum_required(VERSION 3.26.4)
##########################################
option(MOMO_ENABLE_SANITIZER "Enable sanitizer" OFF)
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the emulator as a shared library (without the samples and tests)" OFF)
set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build")
message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}")
add_compile_definitions(MOMO_REFLECTION_LEVEL=${MOMO_REFLECTION_LEVEL})
if(MOMO_BUILD_AS_LIBRARY)
add_compile_definitions(MOMO_BUILD_AS_LIBRARY=1)
else()
add_compile_definitions(MOMO_BUILD_AS_LIBRARY=0)
endif()
##########################################
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
# Prevent unicorn from generating universal binaries on macOS
# It doesn't support it, even if it thinks it does...
set(ENV{ARCHFLAGS} "nope")
##########################################
project(emulator LANGUAGES C CXX)
enable_testing()
##########################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
##########################################
include(cmake/utils.cmake)
include(cmake/compiler-env.cmake)
##########################################
momo_set_new_artifact_directory()
##########################################
momo_add_subdirectory_and_get_targets("deps" EXTERNAL_TARGETS)
momo_add_subdirectory_and_get_targets("src" OWN_TARGETS)
##########################################
momo_targets_set_folder("dependencies" ${EXTERNAL_TARGETS})
momo_targets_exclude_from_all(${EXTERNAL_TARGETS})
momo_targets_disable_warnings(${EXTERNAL_TARGETS})
momo_targets_expose_includes(${OWN_TARGETS})
momo_targets_set_warnings_as_errors(${OWN_TARGETS})