commit
143d5558db
4
.github/workflows/c-cpp.yml
vendored
4
.github/workflows/c-cpp.yml
vendored
@ -8,6 +8,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get install -y clang-tools check
|
run: sudo apt-get install -y clang-tools check cmake
|
||||||
- name: make
|
- name: make
|
||||||
run: make
|
run: make
|
||||||
|
- name: cmake
|
||||||
|
run: "( rm -rf build && mkdir build && cd build && cmake .. && make && ./tests && echo OK )"
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
|
build/
|
||||||
|
cmake-build-*/
|
||||||
*.o
|
*.o
|
||||||
*~
|
*~
|
||||||
*.diff
|
*.diff
|
||||||
|
19
CMakeLists.txt
Normal file
19
CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.3)
|
||||||
|
|
||||||
|
project(minmea)
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED) # Workaround for https://github.com/libcheck/check/issues/48#issuecomment-322965461
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(CHECK REQUIRED check)
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wextra -Werror -std=c99")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_DARWIN_C_SOURCE")
|
||||||
|
|
||||||
|
set(minmea_SRCS minmea.c minmea.h)
|
||||||
|
add_library(minmea ${minmea_SRCS})
|
||||||
|
add_executable(example example.c)
|
||||||
|
add_executable(tests tests.c)
|
||||||
|
target_link_libraries(example minmea)
|
||||||
|
target_link_libraries(tests minmea ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
target_include_directories(tests PUBLIC ${CHECK_INCLUDE_DIRS})
|
||||||
|
target_compile_options(tests PUBLIC ${CHECK_CFLAGS_OTHER})
|
Loading…
Reference in New Issue
Block a user