summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-02-06 13:33:37 +0000
committer0undefined <oscar@nelin.dk>2025-02-26 12:50:01 +0000
commitb2bd9bccd8fffaae76c7f2f8373e641a6dd029d2 (patch)
tree38760758cc632353c53e7b9707a7463310650976 /CMakeLists.txt
Initial commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..32843ad
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,34 @@
+cmake_minimum_required(VERSION 3.24)
+project(rogue VERSION 0.0.1 LANGUAGES C)
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
+
+find_package(Git REQUIRED)
+
+include(FetchContent)
+
+set(CMAKE_DISABLE_IN_SOURCE_BUILD ON CACHE BOOL "Prevents cmake -S. -B.")
+set(CMAKE_DISABLE_SOURCE_CHANGES ON CACHE BOOL "Prevent writing files to CMAKE_SOURCE_DIR under configure")
+
+FetchContent_Declare(daw
+ GIT_REPOSITORY https://codeberg.org/onelin/daw.git
+ GIT_TAG glfw
+)
+
+add_compile_options(-Og -ggdb3 -fno-omit-frame-pointer)
+add_link_options(-Og -ggdb3 -fno-omit-frame-pointer)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_compile_options(-D_DEBUG)
+endif()
+
+FetchContent_MakeAvailable(daw)
+
+daw_add_state(mainstate)
+
+add_executable(${PROJECT_NAME} src/main.c)
+target_link_libraries(${PROJECT_NAME} PUBLIC daw)
+target_include_directories(${PROJECT_NAME} PUBLIC include)