Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorWilliams committed May 10, 2024
1 parent faee6fa commit e46319f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ if(NOT LF_NO_HWLOC)
target_compile_definitions(libfork_libfork INTERFACE LF_USE_HWLOC)
# Link to exported target.
target_link_libraries(libfork_libfork INTERFACE hwloc::hwloc)
# Let user know version
message(STATUS "Found HWLOC version ${hwloc_VERSION}, NUMA support enabled!")
else()

find_package(PkgConfig)
Expand All @@ -79,13 +81,15 @@ if(NOT LF_NO_HWLOC)

unset(HWLOC_FOUND CACHE) # Prevent dirty cache

pkg_search_module(HWLOC IMPORTED_TARGET hwloc>=2.0)
pkg_search_module(HWLOC QUIET IMPORTED_TARGET hwloc>=2.0)

if(HWLOC_FOUND)
# Instructs libfork to use hwloc.
target_compile_definitions(libfork_libfork INTERFACE LF_USE_HWLOC)
# Link to imported target.
target_link_libraries(libfork_libfork INTERFACE PkgConfig::HWLOC)
# Let user know version
message(STATUS "Found HWLOC version ${HWLOC_VERSION}, NUMA support enabled!")
else()
message(WARNING "HWLOC: not found, NUMA support disabled!")
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/install-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if (@hwloc_FOUND@)
elseif(@HWLOC_FOUND@)
find_dependency(PkgConfig)
pkg_search_module(HWLOC REQUIRED IMPORTED_TARGET hwloc)
else()
message(WARNING "This installation of libfork was built without NUMA support!")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/libforkTargets.cmake")

0 comments on commit e46319f

Please sign in to comment.