Compare commits
7 Commits
aca13487c6
...
2a7579fecc
| Author | SHA1 | Date |
|---|---|---|
|
|
2a7579fecc | |
|
|
3fabeb6a52 | |
|
|
fafeedec1e | |
|
|
e8559479fb | |
|
|
6050aa155d | |
|
|
302184f383 | |
|
|
c542c9ada7 |
|
|
@ -50,21 +50,21 @@ jobs:
|
|||
env:
|
||||
cc: gcc
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -B build-${cc}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${cc}
|
||||
podman exec -i stable cmake --build build-${cc}
|
||||
|
||||
- name: Configure & Build with clang
|
||||
env:
|
||||
cc: clang
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -B build-${cc}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${cc} -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${cc}
|
||||
podman exec -i stable cmake --build build-${cc}
|
||||
|
||||
- name: Configure & Build with arm-linux-gnueabihf-gcc
|
||||
env:
|
||||
toolchain: arm-linux-gnueabihf-gcc
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake --build build-${toolchain}
|
||||
|
||||
- name: Configure & Build with arm-linux-gnueabihf-clang
|
||||
|
|
@ -73,14 +73,14 @@ jobs:
|
|||
env:
|
||||
toolchain: arm-linux-gnueabihf-clang
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake --build build-${toolchain}
|
||||
|
||||
- name: Configure & Build with aarch64-linux-gnu-gcc
|
||||
env:
|
||||
toolchain: aarch64-linux-gnu-gcc
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake --build build-${toolchain}
|
||||
|
||||
- name: Configure & Build with aarch64-linux-gnu-clang
|
||||
|
|
@ -89,7 +89,7 @@ jobs:
|
|||
env:
|
||||
toolchain: aarch64-linux-gnu-clang
|
||||
run: |
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=cmake/${toolchain}.cmake -DENABLE_WERROR=ON -DENABLE_GPS=ON -B build-${toolchain}
|
||||
podman exec -i stable cmake --build build-${toolchain}
|
||||
|
||||
- name: Configure & Build with mips-linux-gnu-gcc
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
.ccls-cache
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
compile_commands.json
|
||||
tags
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ project(can-utils LANGUAGES C)
|
|||
|
||||
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
||||
|
||||
include (CheckFunctionExists)
|
||||
include (CheckSymbolExists)
|
||||
include (GNUInstallDirs)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckSymbolExists)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
|
@ -14,6 +14,12 @@ endif()
|
|||
|
||||
# Add an option to enable treating warnings as errors
|
||||
option(ENABLE_WERROR "Treat all compiler warnings as errors" OFF)
|
||||
option(ENABLE_GPS "Enable GPS support" OFF)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
if(ENABLE_GPS)
|
||||
pkg_check_modules(GPS REQUIRED libgps)
|
||||
endif()
|
||||
|
||||
if(ENABLE_WERROR)
|
||||
add_compile_options(-Werror)
|
||||
|
|
@ -32,8 +38,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCLOCK_TAI=11")
|
|||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSO_TXTIME=61")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSCM_TXTIME=SO_TXTIME")
|
||||
|
||||
include_directories (.)
|
||||
include_directories (./include)
|
||||
include_directories(.)
|
||||
include_directories(./include)
|
||||
|
||||
check_function_exists(fork HAVE_FORK)
|
||||
|
||||
|
|
@ -195,21 +201,23 @@ if(NOT ANDROID)
|
|||
j1939-timedate-srv
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
set(PUBLIC_HEADER_J1939_VEHICLE_POSITION
|
||||
j1939_vehicle_position/j1939_vehicle_position_cmn.h
|
||||
)
|
||||
if(ENABLE_GPS)
|
||||
set(PUBLIC_HEADER_J1939_VEHICLE_POSITION
|
||||
j1939_vehicle_position/j1939_vehicle_position_cmn.h
|
||||
)
|
||||
|
||||
add_executable(j1939-vehicle-position-srv
|
||||
j1939_vehicle_position/j1939_vehicle_position_srv.c
|
||||
)
|
||||
add_executable(j1939-vehicle-position-srv
|
||||
j1939_vehicle_position/j1939_vehicle_position_srv.c
|
||||
)
|
||||
|
||||
target_link_libraries(j1939-vehicle-position-srv
|
||||
PRIVATE can j1939 gps
|
||||
)
|
||||
target_link_libraries(j1939-vehicle-position-srv
|
||||
PRIVATE can j1939 ${GPS_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS
|
||||
j1939-vehicle-position-srv
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(TARGETS
|
||||
j1939-vehicle-position-srv
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue