aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt112
1 files changed, 56 insertions, 56 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcb4c09..98e40a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,15 +25,15 @@ add_subdirectory(3rdparty/imguicolortextedit)
add_subdirectory(3rdparty/tracy)
# ==============================================================================
-# Layer 10 (standalone, throw-into-the-buildsystem style)
+# Layer 1 (standalone, throw-into-the-buildsystem style)
-file(GLOB_RECURSE 10-common_SOURCES
- source/10-common/*.c
- source/10-common/*.cpp
+file(GLOB_RECURSE brussel_common_SOURCES
+ src/brussel.common/*.c
+ src/brussel.common/*.cpp
)
-add_library(10-common OBJECT ${10-common_SOURCES})
+add_library(brussel.common OBJECT ${brussel_common_SOURCES})
-set_target_properties(10-common PROPERTIES
+set_target_properties(brussel.common PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
@@ -42,8 +42,8 @@ set_target_properties(10-common PROPERTIES
UNITY_BUILD OFF
)
-target_include_directories(10-common PUBLIC source/10-common)
-target_link_libraries(10-common PUBLIC
+target_include_directories(brussel.common PUBLIC src/brussel.common)
+target_link_libraries(brussel.common PUBLIC
# Conan external dependencies
cxxopts::cxxopts
robin_hood::robin_hood
@@ -59,77 +59,77 @@ target_link_libraries(10-common PUBLIC
stb::stb
)
-file(GLOB_RECURSE 10-editor-common_SOURCES
- source/10-editor-common/*.c
- source/10-editor-common/*.cpp
+file(GLOB_RECURSE brussel_editor_common_SOURCES
+ src/brussel.editor.common/*.c
+ src/brussel.editor.common/*.cpp
)
-add_library(10-editor-common OBJECT ${10-editor-common_SOURCES})
+add_library(brussel.editor.common OBJECT ${brussel_editor_common_SOURCES})
-set_target_properties(10-editor-common PROPERTIES
+set_target_properties(brussel.editor.common PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
UNITY_BUILD OFF
)
-target_include_directories(10-editor-common PUBLIC source/10-editor-common)
-target_link_libraries(10-editor-common PUBLIC
+target_include_directories(brussel.editor.common PUBLIC src/brussel.editor.common)
+target_link_libraries(brussel.editor.common PUBLIC
# Vendored eternal dependencies
imgui
# Project internal components
- 10-common
+ brussel.common
)
# ==============================================================================
-# Layer 20 (building tools)
+# Layer 2 (building tools)
-file(GLOB_RECURSE 20-codegen-runtime_SOURCES
- source/20-codegen-runtime/*.c
- source/20-codegen-runtime/*.cpp
+file(GLOB_RECURSE brussel_codegen_rt_SOURCES
+ src/brussel.codegen.rt/*.c
+ src/brussel.codegen.rt/*.cpp
)
-add_library(20-codegen-runtime OBJECT ${20-codegen-runtime_SOURCES})
+add_library(brussel.codegen.rt OBJECT ${brussel_codegen_rt_SOURCES})
-set_target_properties(20-codegen-runtime PROPERTIES
+set_target_properties(brussel.codegen.rt PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
-target_include_directories(20-codegen-runtime PUBLIC source/20-codegen-runtime)
-target_link_libraries(20-codegen-runtime PUBLIC
+target_include_directories(brussel.codegen.rt PUBLIC src/brussel.codegen.rt)
+target_link_libraries(brussel.codegen.rt PUBLIC
# Project internal components
- 10-common
+ brussel.common
)
# NOTE: delibrately not recursive, because this target can contain non-source files with .cpp extensions in the folder
-file(GLOB 20-codegen-compiler_SOURCES
- source/20-codegen-compiler/*.c
- source/20-codegen-compiler/*.cpp
+file(GLOB brussel_codegen_comp_SOURCES
+ src/brussel.codegen.comp/*.c
+ src/brussel.codegen.comp/*.cpp
)
-add_executable(20-codegen-compiler ${20-codegen-compiler_SOURCES})
+add_executable(brussel.codegen.comp ${brussel_codegen_comp_SOURCES})
-set_target_properties(20-codegen-compiler PROPERTIES
+set_target_properties(brussel.codegen.comp PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
-target_link_libraries(20-codegen-compiler PRIVATE
+target_link_libraries(brussel.codegen.comp PRIVATE
# Project internal components
- 10-common
+ brussel.common
)
-target_flag_exceptions(20-codegen-compiler ON)
-target_flag_rtti(20-codegen-compiler OFF)
+target_flag_exceptions(brussel.codegen.comp ON)
+target_flag_rtti(brussel.codegen.comp OFF)
option(BRUSSEL_CODEGEN_DEBUG_PRINT "Enable debug printing in the code generator or not." OFF)
if(BRUSSEL_CODEGEN_DEBUG_PRINT)
- target_compile_definitions(20-codegen-compiler PRIVATE CODEGEN_DEBUG_PRINT=1)
+ target_compile_definitions(brussel.codegen.comp PRIVATE CODEGEN_DEBUG_PRINT=1)
endif()
# ==============================================================================
-# Layer 30 (final products)
+# Layer 3 (final products)
function(add_projectized_executable)
# Add a library target
@@ -168,7 +168,7 @@ function(add_projectized_executable)
if(arg_ENABLE_CODEGEN)
set(var_OUTPUT_DIR ${CMAKE_BINARY_DIR}/generated/${arg_TARGET_NAME})
target_include_directories(${arg_TARGET_NAME} PRIVATE ${var_OUTPUT_DIR})
- target_link_libraries(${arg_TARGET_NAME} PRIVATE 20-codegen-runtime)
+ target_link_libraries(${arg_TARGET_NAME} PRIVATE brussel.codegen.rt)
# https://stackoverflow.com/questions/70371064/run-custom-command-with-modified-files-as-arguments
set(var_STAMPS "")
@@ -210,11 +210,11 @@ function(add_projectized_executable)
add_custom_target(${arg_TARGET_NAME}delete-stamp-list COMMAND "${CMAKE_COMMAND}" -E rm -f "${var_STAMP_LIST}")
add_custom_target(${arg_TARGET_NAME}update-stamps DEPENDS ${var_STAMPS})
add_dependencies(${arg_TARGET_NAME}update-stamps ${arg_TARGET_NAME}delete-stamp-list)
-
+
# Actually generate the files, based on the list of changed files
add_custom_command(
OUTPUT ${var_GENERATED_FILE_LIST}
- COMMAND 20-codegen-compiler
+ COMMAND brussel.codegen.comp
--output-dir=${var_OUTPUT_DIR}/generated
--database=${var_OUTPUT_DIR}/model.sqlite3
fileList:${var_STAMP_LIST}
@@ -224,22 +224,22 @@ function(add_projectized_executable)
endfunction()
add_projectized_executable(
- TARGET_NAME 30-game
- TARGET_SOURCE_DIR source/30-game/
+ TARGET_NAME brussel.engine
+ TARGET_SOURCE_DIR src/brussel.engine/
ENABLE_CODEGEN ON
)
-set_target_properties(30-game PROPERTIES
+set_target_properties(brussel.engine PROPERTIES
UNITY_BUILD_MODE BATCH
UNITY_BUILD_UNIQUE_ID "ProjectBrussel_UNITY_ID"
)
-target_compile_definitions(30-game PRIVATE
+target_compile_definitions(brussel.engine PRIVATE
RAPIDJSON_HAS_STDSTRING=1
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
)
-target_link_libraries(30-game PRIVATE
+target_link_libraries(brussel.engine PRIVATE
# Vendored external dependencies
OpenGL::GL
glfw
@@ -248,17 +248,17 @@ target_link_libraries(30-game PRIVATE
tracy
# Project internal components
- 10-common
- 10-editor-common
+ brussel.common
+ brussel.editor.common
)
-target_flag_exceptions(30-game ON)
-target_flag_rtti(30-game ON)
-target_use_windows_subsystem(30-game)
+target_flag_exceptions(brussel.engine ON)
+target_flag_rtti(brussel.engine ON)
+target_use_windows_subsystem(brussel.engine)
option(BRUSSEL_ENABLE_PROFILING "Whether profiling support is enabled or not." OFF)
if(BRUSSEL_ENABLE_PROFILING)
- target_compile_definitions(10-common
+ target_compile_definitions(brussel.common
PUBLIC
TRACY_ENABLE
)
@@ -266,7 +266,7 @@ endif()
option(BRUSSEL_ENABLE_DEV_ENV "Enable dev environment features or not." ON)
if(BRUSSEL_ENABLE_DEV_ENV)
- target_compile_definitions(10-common
+ target_compile_definitions(brussel.common
PUBLIC
BRUSSEL_DEV_ENV=1
)
@@ -274,7 +274,7 @@ endif()
option(BRUSSEL_ENABLE_EDITOR "Enable editor support or not." ON)
if(BRUSSEL_ENABLE_EDITOR)
- target_compile_definitions(10-common
+ target_compile_definitions(brussel.common
PUBLIC
BRUSSEL_ENABLE_EDITOR=1
)
@@ -283,12 +283,12 @@ endif()
option(BRUSSEL_ENABLE_ASAN "Enable AddressSanitizer or not." OFF)
if(BRUSSEL_ENABLE_ASAN)
# Shared to all downstream targets
- target_compile_options(10-common
+ target_compile_options(brussel.common
PUBLIC
-fsanitize=address
-fno-omit-frame-pointer
)
- target_link_options(10-common
+ target_link_options(brussel.common
PUBLIC
-fsanitize=address
-fno-omit-frame-pointer
@@ -298,11 +298,11 @@ endif()
option(BRUSSEL_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer or not." OFF)
if(BRUSSEL_ENABLE_UBSAN)
# Shared to all downstream targets
- target_compile_options(10-common
+ target_compile_options(brussel.common
INTERFACE
-fsanitize=undefined
)
- target_link_options(10-common
+ target_link_options(brussel.common
INTERFACE
-fsanitize=undefined
)