Compare commits
5 commits
f65d980956
...
22364132ea
| Author | SHA1 | Date | |
|---|---|---|---|
| 22364132ea | |||
|
|
d654c75f0a | ||
|
|
119af7a20a | ||
|
|
c102040831 | ||
|
|
96a120e74e |
5 changed files with 45 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)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c")
|
||||||
|
add_library(cosms-core STATIC ${SRC_FILES})
|
||||||
|
target_include_directories(cosms-core PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
target_compile_options(cosms-core PRIVATE /W4)
|
||||||
|
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)
|
||||||
7
include/cosms-core/file.h
Normal file
7
include/cosms-core/file.h
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef COSMS_CORE_FILE
|
||||||
|
#define COSMS_CORE_FILE
|
||||||
|
|
||||||
|
void cosms_core_file_read(char *path);
|
||||||
|
void cosms_core_file_write(char *path);
|
||||||
|
|
||||||
|
#endif
|
||||||
11
src/file.c
Normal file
11
src/file.c
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include <cosms-core/file.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void cosms_core_file_read(char *path) {
|
||||||
|
printf("Hello, World!");
|
||||||
|
}
|
||||||
|
|
||||||
|
void cosms_core_file_write(char *path) {
|
||||||
|
printf("Hello, World");
|
||||||
|
}
|
||||||
6
tests/main.c
Normal file
6
tests/main.c
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include <cosms-core/file.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
cosms_core_file_read("test.txt");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue