diff options
| author | onelin <oscar@nelin.dk> | 2025-10-31 23:55:42 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2025-11-02 22:07:17 +0000 |
| commit | d38deeef3af2316a666f8fc0173940bd769b748e (patch) | |
| tree | 6e30d4a9eea18daa5705c894f28cd99ff047e8f9 /src/CMakeLists.txt | |
| parent | 6c077751982ea2c7bd2d9262b01b9f8602f80dc8 (diff) | |
Flatten project structure
This will make it easier to break up the code into smaller chunks again
later.
One would think doing this seems fun to me at this point.
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 73 |
1 files changed, 57 insertions, 16 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8b9cc1d..2e915f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,25 +1,71 @@ # Set global include dirs set(DAW_INCLUDE_DIRS - ${CMAKE_CURRENT_LIST_DIR}/core/include - ${CMAKE_CURRENT_LIST_DIR}/ctrl/include + ${CMAKE_CURRENT_LIST_DIR}/include ${CMAKE_CURRENT_LIST_DIR}/rendering/include - ${CMAKE_CURRENT_LIST_DIR}/resources/include - ${CMAKE_CURRENT_LIST_DIR}/utils/include ${CMAKE_BINARY_DIR}/include ) -# Add the engine modules -add_subdirectory(core) -add_subdirectory(ctrl) -add_subdirectory(rendering) -add_subdirectory(resources) -add_subdirectory(utils) +add_custom_command( + OUTPUT ${GLAD_HEADER} + COMMAND + glad + --api gl:core=4.6 + --out-path ${CMAKE_BINARY_DIR} + --reproducible + c + --header-only + --mx + ) + # DAW Engine compilation spec add_library(${PROJECT_NAME} + # User facing API + api/daw.h + + # Types and (internal) interfaces + include/daw/platform.h + include/daw/types.h + + # Utility algorithms & datastructures + include/daw/utils.h + include/daw/utils/list.h + btree.c include/daw/utils/btree.h + fov.c include/daw/utils/fov.h + hashmap.c include/daw/utils/hashmap.h + misc.c + stack.c include/daw/utils/stack.h + + # Core functionality + daw.c include/daw/daw.h + dltools.c include/daw/dltools.h + logging.c include/daw/logging.h + memory.c include/daw/memory.h + state.c include/daw/state.h + + # Peripheral IO + input.c include/daw/input.h + include/daw/keycodes.h + include/daw/scancodes.h + + # The rendering & presentation mess + gl.c + platform_glfw.c include/daw/platform_glfw.h + rendering.c include/daw/rendering.h + textures.c include/daw/texture.h + window.c include/daw/window.h + + # Resource handling + model.c include/daw/model.h + resources.c include/daw/resources.h + + # Autogenerated header ${GLAD_HEADER} ) +set_property(SOURCE src/window.c APPEND PROPERTY OBJECT_DEPENDS ${GLAD_HEADER}) +set_property(SOURCE src/rendering.c APPEND PROPERTY OBJECT_DEPENDS ${GLAD_HEADER}) + set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C C_STANDARD 99 @@ -27,19 +73,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES target_include_directories(${PROJECT_NAME} PUBLIC include - # TODO include stb (??) ${CMAKE_BINARY_DIR}/include ) target_link_libraries(${PROJECT_NAME} glfw OpenGL::GL + assimp cglm - daw_core - daw_rendering - daw_ctrl - daw_resources - daw_utils $<$<NOT:$<PLATFORM_ID:Windows>>:m> $<$<BOOL:${DAW_BUILD_HOTRELOAD}>:dl> $<$<AND:$<NOT:$<C_COMPILER_ID:MSVC>>,$<BOOL:${DAW_BUILD_UBSAN}>>:ubsan> |
