blob: 19518bf2eb1fcaca751a43da544280a6183bb985 (
plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
cmake_minimum_required(VERSION 3.13)
project(ProjectBrussel LANGUAGES C CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
include(buildtools/cmake/RTTI.cmake)
find_package(OpenGL REQUIRED)
add_subdirectory(3rdparty/glfw)
add_subdirectory(3rdparty/glm)
add_subdirectory(3rdparty/imgui)
add_subdirectory(3rdparty/imguicolortextedit)
add_subdirectory(3rdparty/tracy)
# ==============================================================================
file(GLOB_RECURSE commonthings_SOURCES source-common/*.c source-common/*.cpp)
add_library(commonthings OBJECT ${commonthings_SOURCES})
set_target_properties(commonthings PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
# Many files include platform headers, we don't want to leak them - it's just simpler to disable unity build for everything
UNITY_BUILD OFF
)
target_include_directories(commonthings PUBLIC source-common)
target_link_libraries(commonthings PUBLIC
# External dependencies
${CONAN_LIBS}
glm::glm
)
# ==============================================================================
# NOTE: delibrately not recursive, see README.md in the folder for details
file(GLOB meta_codegen_SOURCES buildtools/codegen/*.c buildtools/codegen/*.cpp)
add_executable(meta_codegen ${meta_codegen_SOURCES})
set_target_properties(meta_codegen PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
UNITY_BUILD OFF
)
target_link_libraries(meta_codegen PRIVATE
# External dependencies
${CONAN_LIBS}
# Project internal components
commonthings
)
target_flag_rtti(meta_codegen OFF)
# ==============================================================================
# add_executable requires at least one source file
add_executable(${PROJECT_NAME} dummy.c)
add_subdirectory(source)
set_target_properties(${PROJECT_NAME} PROPERTIES
UNITY_BUILD_MODE BATCH
UNITY_BUILD_UNIQUE_ID "${PROJECT_NAME}_UNITY_ID"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
RAPIDJSON_HAS_STDSTRING=1
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
BRUSSEL_DEV_ENV=1
)
target_include_directories(${PROJECT_NAME} PRIVATE
sources
)
target_link_libraries(${PROJECT_NAME} PRIVATE
# External dependencies
${CONAN_LIBS}
OpenGL::GL
glfw
glm::glm
imgui
ImGuiColorTextEdit
tracy
# Project internal components
commonthings
)
option(BRUSSEL_ENABLE_PROFILING "Whether profiling support is enabled or not." OFF)
if(BRUSSEL_ENABLE_PROFILING)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
TRACY_ENABLE
)
endif()
option(BRUSSEL_ENABLE_EDITOR "Enable editor support or not." ON)
if(BRUSSEL_ENABLE_EDITOR)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
BRUSSEL_ENABLE_EDITOR=1
)
endif()
option(BRUSSEL_ENABLE_ASAN "Enable AddressSanitizer or not." OFF)
if(BRUSSEL_ENABLE_ASAN)
target_compile_options(${PROJECT_NAME}
PRIVATE
-fsanitize=address
-fno-omit-frame-pointer
)
target_link_options(${PROJECT_NAME}
PRIVATE
-fsanitize=address
-fno-omit-frame-pointer
)
endif()
|