Skip to content

Commit ce7a814

Browse files
Add minimal cmake setup for linking hwloc when it's needed.
1 parent d36b74b commit ce7a814

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ target_include_directories(qthread
6969
)
7070
set_target_properties(qthread PROPERTIES C_VISIBILITY_PRESET hidden)
7171
target_link_libraries(qthread PUBLIC Threads::Threads)
72+
if ("${QTHREADS_TOPOLOGY}" STREQUAL "hwloc" OR "${QTHREADS_TOPOLOGY}" STREQUAL "binders")
73+
# TODO: pull this out into a simple module file so we can just do find_package instead.
74+
find_library(HWLOC_LIBRARY NAMES hwloc PATH_SUFFIXES lib lib64)
75+
target_link_libraries(qthread PUBLIC "${HWLOC_LIBRARY}")
76+
endif()
7277
target_include_directories(qthread
7378
PUBLIC
7479
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

0 commit comments

Comments
 (0)