cosms-core/CMakeLists.txt

21 lines
642 B
Text
Raw Permalink Normal View History

2025-11-27 19:48:19 +01:00
cmake_minimum_required(VERSION 3.10)
project(cosms-core C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
file(GLOB_RECURSE SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c")
2025-11-27 19:48:19 +01:00
add_library(cosms-core STATIC ${SRC_FILES})
target_include_directories(cosms-core PUBLIC ${PROJECT_SOURCE_DIR}/include)
2025-11-27 19:48:19 +01:00
if (MSVC)
target_compile_options(cosms-core PRIVATE /W4)
2025-11-27 19:48:19 +01:00
else()
target_compile_options(cosms-core PRIVATE -wall -Wextra -pedantic)
endif()
add_executable(cosms-core-test ${PROJECT_SOURCE_DIR}/tests/main.c)
target_include_directories(cosms-core-test PRIVATE ${PROJECT_SOURCE_DIR}/tests)
target_link_libraries(cosms-core-test cosms-core)