Remove pthreads
Some checks failed
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=OFF (push) Successful in 14s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=OFF (push) Successful in 15s
CMake / ubuntu-latest - shared=ON, pthread=OFF, posix=ON (push) Has been cancelled
CMake / ubuntu-latest - shared=OFF, pthread=ON, posix=ON (push) Has been cancelled
CMake / ubuntu-latest - shared=ON, pthread=ON, posix=ON (push) Has been cancelled
CMake / ubuntu-latest - shared=OFF, pthread=OFF, posix=ON (push) Has been cancelled

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-08-09 08:39:55 +03:00
parent 41badf33d9
commit ec3bf6061d
3 changed files with 18 additions and 89 deletions

View File

@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.10)
project(DCFG C)
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)
option(DCFG_ASAN "Enable AddressSanitizer" OFF)
@@ -37,12 +36,6 @@ add_library(${PROJECT_NAME}_static STATIC ${SRC_DIR}/dcfg.c)
set_target_properties(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME "dcfg")
foreach(TARGET ${PROJECT_NAME}_shared ${PROJECT_NAME}_static)
if(DCFG_PTHREAD_SUPPORT)
find_package(Threads REQUIRED)
target_link_libraries(${TARGET} PRIVATE Threads::Threads)
target_compile_definitions(${TARGET} PRIVATE DCFG_PTHREAD_SUPPORT)
endif()
if(DCFG_POSIX_SUPPORT)
target_compile_definitions(${TARGET} PRIVATE DCFG_POSIX_SUPPORT)
endif()
@@ -77,10 +70,6 @@ if(DCFG_BUILD_PROGRAMS)
target_include_directories(${PROG_NAME} PRIVATE ${INCLUDE_DIR})
target_link_libraries(${PROG_NAME} PRIVATE ${PROJECT_NAME}_static)
if(DCFG_PTHREAD_SUPPORT)
target_link_libraries(${PROG_NAME} PRIVATE Threads::Threads)
endif()
if(MSVC)
target_compile_options(${PROG_NAME} PRIVATE /W4 /permissive-)
else()