36
.gitea/workflows/cmake.yml
Normal file
36
.gitea/workflows/cmake.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
name: CMake
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'release-*'
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
shared: ["ON", "OFF"]
|
||||
pthread_support: ["ON", "OFF"]
|
||||
posix_support: ["ON", "OFF"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: ${{ matrix.os }} - shared=${{ matrix.shared }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake build-essential
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -Bbuild -S . \
|
||||
-DDCFG_BUILD_SHARED=${{ matrix.shared }} \
|
||||
-DDCFG_PTHREAD_SUPPORT=${{ matrix.pthread_support }} \
|
||||
-DDCFG_POSIX_SUPPORT=${{ matrix.posix_support }}
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build build
|
||||
|
@@ -7,7 +7,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
|
||||
option(DCFG_BUILD_SHARED "Build DCFG as a shared library" ON)
|
||||
option(DCFG_BUILD_STATIC "Build DCFG as a static library" OFF)
|
||||
option(DCFG_PTHREAD_SUPPORT "Enable pthreads support" ON)
|
||||
option(DCFG_POSIX_SUPPORT "Enable POSIX support" ON)
|
||||
|
||||
@@ -31,9 +30,7 @@ if(DCFG_BUILD_SHARED)
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "dcfg")
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
|
||||
endif()
|
||||
|
||||
if(DCFG_BUILD_STATIC)
|
||||
else()
|
||||
add_library(${PROJECT_NAME}_static STATIC ${SRC_DIR}/dcfg.c)
|
||||
target_include_directories(${PROJECT_NAME}_static PUBLIC ${INCLUDE_DIR})
|
||||
|
||||
|
Reference in New Issue
Block a user