build(cmake): setup cmake build file
This commit is contained in:
parent
f65d980956
commit
96a120e74e
2 changed files with 21 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -66,3 +66,4 @@ CTestTestfile.cmake
|
||||||
_deps
|
_deps
|
||||||
CMakeUserPresets.json
|
CMakeUserPresets.json
|
||||||
|
|
||||||
|
./build
|
||||||
|
|
|
||||||
20
CMakeLists.txt
Normal file
20
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(cosms-core C)
|
||||||
|
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||||
|
file(GLOB_RECURSE SRC_FILES "${PROJECT_SOURCE_DIR}/Src/*.c")
|
||||||
|
|
||||||
|
add_library(cosms-core STATIC ${SRC_FILES})
|
||||||
|
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)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
target_compile_options(cosms-core PRIVATE /W4 /Zl)
|
||||||
|
else()
|
||||||
|
target_compile_options(cosms-core PRIVATE -wall -Wextra -pedantic)
|
||||||
|
endif()
|
||||||
Loading…
Add table
Reference in a new issue