aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-23 19:39:13 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-23 19:39:26 +0200
commit421300c27123ca647772dc6d9bd0cabf7f5f9c99 (patch)
treed916b62056b2440aef374b21373d16272bb709ee /CMakeLists.txt
parent53e9e371a16ae2d167f1fc2577dff2c2426eed68 (diff)
refactor: src & pragma once
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 5 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c022fc3..a5fd18e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,26 +2,13 @@ cmake_minimum_required(VERSION 3.30.5)
project(kagamic VERSION 0.1 LANGUAGES C)
set(CMAKE_C_STANDARD 17)
-add_executable(main
- main.c
- string.h string.c
- memory.h memory.c
- vec.h vec.c
- json.h json.c
- log.h log.c
-)
+file(GLOB SOURCES "src/*.c")
+file(GLOB TEST_SOURCES "test/*.c")
+
+add_executable(main main.c ${SOURCES})
target_link_libraries(main m)
target_compile_options(main PRIVATE -Wall -pedantic -Wextra)
-
-add_executable(test
- test.c
- testing.h
- string.h string.c
- memory.h memory.c
- vec.h vec.c
- json.h json.c
- log.h log.c
-)
+add_executable(test test.c ${SOURCES} ${TEST_SOURCES})
target_link_libraries(test m)
target_compile_options(test PRIVATE -Wall -pedantic -Wextra)