File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,20 @@ target_include_directories(qthread
7676 PRIVATE "../include"
7777)
7878set_target_properties (qthread PROPERTIES C_VISIBILITY_PRESET hidden)
79+
80+ # Link pthreads.
7981target_link_libraries (qthread PUBLIC Threads::Threads)
82+
83+ # The c11 threading library has to be linked
84+ # via a separate library on BSD OSs.
85+ if ("${CMAKE_SYSTEM_NAME} " STREQUAL "FreeBSD" OR
86+ "${CMAKE_SYSTEM_NAME} " STREQUAL "kFreeBSD" OR
87+ "${CMAKE_SYSTEM_NAME} " STREQUAL "OpenBSD" OR
88+ "${CMAKE_SYSTEM_NAME} " STREQUAL "NetBSD" OR
89+ "${CMAKE_SYSTEM_NAME} " STREQUAL "DragonFly" )
90+ target_link_libraries (qthread PUBLIC "stdthreads" )
91+ endif ()
92+
8093if ("${QTHREADS_TOPOLOGY} " STREQUAL "hwloc" OR "${QTHREADS_TOPOLOGY} " STREQUAL "binders" )
8194 find_package (hwloc REQUIRED)
8295 target_include_directories (qthread PRIVATE "${hwloc_INCLUDE_DIR} " )
You can’t perform that action at this time.
0 commit comments