set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)

add_library(sem-wrapper SHARED "")

target_sources(sem-wrapper
PRIVATE
    "${CMAKE_CURRENT_SOURCE_DIR}/sem_wrapper.c"
PUBLIC
    "${CMAKE_CURRENT_SOURCE_DIR}/sem_wrapper.h"
)

## If no linkage happens all compiles but sem_timedwait() fails

# target_link_libraries(sem-wrapper
# PUBLIC
#     Threads::Threads # -lpthread
# )
