aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt50
1 files changed, 49 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad2bf16..3d349c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,50 @@ 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
+)
+
+# ==============================================================================
+
# add_executable requires at least one source file
add_executable(${PROJECT_NAME} dummy.c)
add_subdirectory(source)
@@ -20,8 +64,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
UNITY_BUILD_UNIQUE_ID "${PROJECT_NAME}_UNITY_ID"
)
-target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES
+ CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
@@ -37,6 +81,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
)
target_link_libraries(${PROJECT_NAME} PRIVATE
+ # External dependencies
${CONAN_LIBS}
OpenGL::GL
glfw
@@ -44,6 +89,9 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
imgui
ImGuiColorTextEdit
tracy
+
+ # Project internal components
+ commonthings
)
option(BRUSSEL_ENABLE_PROFILING "Whether profiling support is enabled or not." OFF)