Skip to content

Commit

Permalink
rt and psapi are now a dependency of the UTILS library.
Browse files Browse the repository at this point in the history
  • Loading branch information
salome-eriksson committed Aug 3, 2023
1 parent 0f0b6d6 commit badc5ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
15 changes: 15 additions & 0 deletions src/cmake_modules/FastDownwardMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ function(create_fast_downward_library)
foreach(DEPENDENCY ${_LIBRARY_DEPENDS})
target_link_libraries(downward_${_LIBRARY_NAME} INTERFACE downward_${DEPENDENCY})
endforeach()
# TODO: This feels very hacky. I'd rather have the ability to specify
# external dependencies in DownwardFiles.cmake (i.e. new parameter
# DEPENDSEXTERNAL) but how to specify conditions there?
if (${_LIBRARY_NAME} STREQUAL "UTILS")
# On Linux, find the rt library for clock_gettime().
if(UNIX AND NOT APPLE)
target_link_libraries(downward_${_LIBRARY_NAME} INTERFACE rt)
endif()

# On Windows, find the psapi library for determining peak memory.
if(WIN32)
cmake_policy(SET CMP0074 NEW)
target_link_libraries(downward_${_LIBRARY_NAME} INTERFACE psapi)
endif()
endif()

if (_LIBRARY_CORE_LIBRARY OR LIBRARY_${_LIBRARY_NAME}_ENABLED)
target_link_libraries(downward PUBLIC downward_${_LIBRARY_NAME})
Expand Down
14 changes: 0 additions & 14 deletions src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/DownwardFiles.cmake")

## == Libraries ==

# TODO the next two libraries should be dependencies of the (interface) library
# that actually uses the corresponding methods (probably the one containing system.h?).

# On Linux, find the rt library for clock_gettime().
if(UNIX AND NOT APPLE)
target_link_libraries(downward PRIVATE rt)
endif()

# On Windows, find the psapi library for determining peak memory.
if(WIN32)
cmake_policy(SET CMP0074 NEW)
target_link_libraries(downward PRIVATE psapi)
endif()

# If any enabled plugin requires an LP solver, compile with all
# available LP solvers. If no solvers are installed, the planner will
# still compile, but using heuristics that depend on an LP solver will
Expand Down

0 comments on commit badc5ea

Please sign in to comment.