Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI: Link to Pthread library explicitly #54

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/signal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ project(test-signal VERSION 0.1 LANGUAGES CXX)
add_executable(${PROJECT_NAME}
tst_signal.cpp
)
target_link_libraries(${PROJECT_NAME} KDAB::KDBindings)
# For some reason, CMake with gcc doesn't automatically include the pthread library
# when using std::thread. This is a workaround for that.
# IMHO, this is ridiculous, std::thread is part of the standard library, it should just work
# when I use C++, but it is what it is.
# See: https://cmake.cmake.narkive.com/wWDhK9RQ/undefined-reference-to-pthread-create
find_package (Threads)
target_link_libraries(${PROJECT_NAME} KDAB::KDBindings ${CMAKE_THREAD_LIBS_INIT})

add_test(${PROJECT_NAME} ${PROJECT_NAME})