From d38deeef3af2316a666f8fc0173940bd769b748e Mon Sep 17 00:00:00 2001 From: onelin Date: Sat, 1 Nov 2025 00:55:42 +0100 Subject: 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. --- src/CMakeLists.txt | 73 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 16 deletions(-) (limited to 'src/CMakeLists.txt') 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 $<$>:m> $<$:dl> $<$>,$>:ubsan> -- cgit v1.3