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
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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user