summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt40
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/core/CMakeLists.txt10
-rw-r--r--src/ctrl/CMakeLists.txt7
-rw-r--r--src/rendering/CMakeLists.txt6
-rw-r--r--src/resources/CMakeLists.txt5
-rw-r--r--src/ui/CMakeLists.txt4
-rw-r--r--src/utils/CMakeLists.txt8
8 files changed, 63 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e1b54d..ca9021a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.24)
-project(daw VERSION 0.0.1 LANGUAGES C)
+project(daw
+ VERSION 0.0.1
+ DESCRIPTION "A Simple Hobby Game Engine"
+ LANGUAGES C)
# We really don't want any in-source builds
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON CACHE BOOL "Prevents cmake -S. -B.")
@@ -89,34 +92,19 @@ FetchContent_Declare(cglm
FetchContent_MakeAvailable(cglm)
## Compilation information
-
-set(ENGINE_SOURCES
- src/btree.c
- src/dltools.c
- src/engine.c
- src/fov.c
- src/hashmap.c
- src/input.c
- src/logging.c
- src/memory.c
- src/rendering.c
- src/stack.c
- src/state.c
- src/ui_positioning.c
- src/ui_rendering.c
- src/utils.c
- src/vector.c
-)
+add_subdirectory(src)
add_compile_options(${RELEASE_OPTS})
add_link_options(${RELEASE_OPTS})
-add_library(daw
+add_library(${PROJECT_NAME}
${CMAKE_BINARY_DIR}/include/glad/gl.h
- ${ENGINE_SOURCES}
+ #${ENGINE_SOURCES}
)
-target_include_directories(daw PUBLIC
+set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C)
+
+target_include_directories(${PROJECT_NAME} PUBLIC
include
${CMAKE_BINARY_DIR}/include
${ENGINE_INCLUDE})
@@ -125,7 +113,13 @@ target_link_libraries(${PROJECT_NAME}
glfw
OpenGL::GL
cglm
- $<$<NOT:$<PLATFORM_ID:Windows>>:m>
+ daw_core
+ daw_rendering
+ daw_ctrl
+ daw_resources
+ daw_ui
+ daw_utils
+ NOT:$<PLATFORM_ID:Windows>>:m>
$<$<BOOL:${DAW_BUILD_HOTRELOAD}>:dl>
$<$<AND:$<NOT:$<C_COMPILER_ID:MSVC>>,$<BOOL:${DAW_BUILD_UBSAN}>>:ubsan>
)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..5f0b8b5
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_subdirectory(core)
+add_subdirectory(ctrl)
+add_subdirectory(rendering)
+add_subdirectory(resources)
+add_subdirectory(ui)
+add_subdirectory(utils)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
new file mode 100644
index 0000000..f8c0315
--- /dev/null
+++ b/src/core/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_library(daw_core
+ cleanup.c
+ dltools.c
+ harness.c
+ init.c
+ logging.c
+ loop.c
+ memory.c
+ state.c
+ )
diff --git a/src/ctrl/CMakeLists.txt b/src/ctrl/CMakeLists.txt
new file mode 100644
index 0000000..e086f07
--- /dev/null
+++ b/src/ctrl/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_library(daw_ctrl
+ controller.c
+ ctx.c
+ input.c
+ keyboard.c
+ mouse.c
+ )
diff --git a/src/rendering/CMakeLists.txt b/src/rendering/CMakeLists.txt
new file mode 100644
index 0000000..a7313e9
--- /dev/null
+++ b/src/rendering/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_library(daw_rendering
+ gl.c
+ rendering.c
+ text.c
+ window.c
+ )
diff --git a/src/resources/CMakeLists.txt b/src/resources/CMakeLists.txt
new file mode 100644
index 0000000..7fe5cac
--- /dev/null
+++ b/src/resources/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(daw_resources
+ fonts.c
+ scripts.c
+ textures.c
+ )
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
new file mode 100644
index 0000000..05b2648
--- /dev/null
+++ b/src/ui/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(daw_ui
+ positioning.c
+ rendering.c
+ )
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
new file mode 100644
index 0000000..3274f55
--- /dev/null
+++ b/src/utils/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(daw_utils
+ btree.c
+ fov.c
+ hashmap.c
+ misc.c
+ stack.c
+ vector.c
+ )