Add dump
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Failing after 13s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Successful in 16s
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Failing after 14s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Successful in 17s
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Failing after 18s
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Successful in 15s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-07-26 23:41:34 +03:00
parent 0b5c556f84
commit e49654efb1
6 changed files with 411 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ set(CMAKE_C_EXTENSIONS ON) # Would've done OFF but I need typeof (for now)
option(DCFG_BUILD_SHARED "Build DCFG as a shared library" ON)
option(DCFG_PTHREAD_SUPPORT "Enable pthreads support" ON)
option(DCFG_POSIX_SUPPORT "Enable POSIX support" ON)
option(DCFG_BUILD_PROGRAMS "Build DCFG example programs" ON)
find_package(Threads)
@@ -54,3 +55,24 @@ if(MSVC)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-newline-eof -Wno-language-extension-token)
endif()
if(DCFG_BUILD_PROGRAMS)
set(PROGRAMS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/programs)
file(GLOB PROGRAM_SOURCES "${PROGRAMS_DIR}/*.c")
foreach(PROG_SRC ${PROGRAM_SOURCES})
get_filename_component(PROG_NAME ${PROG_SRC} NAME_WE)
add_executable(${PROG_NAME} ${PROG_SRC})
target_include_directories(${PROG_NAME} PRIVATE ${INCLUDE_DIR})
target_link_libraries(${PROG_NAME} PRIVATE ${PROJECT_NAME})
if(DCFG_PTHREAD_SUPPORT)
target_link_libraries(${PROG_NAME} PRIVATE Threads::Threads)
endif()
if(MSVC)
target_compile_options(${PROG_NAME} PRIVATE /W4 /permissive-)
else()
target_compile_options(${PROG_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-newline-eof -Wno-language-extension-token)
endif()
install(TARGETS ${PROG_NAME} DESTINATION bin)
endforeach()
endif()