Skip to content

Commit

Permalink
#2183: Make vt_ldms_includes/lib optional
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Oct 5, 2023
1 parent 285a243 commit 1e0716e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
9 changes: 0 additions & 9 deletions cmake/check_system_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,3 @@ check_function_exists(sysinfo vt_has_sysinfo)

set(CMAKE_REQUIRED_INCLUDES "mach/mach.h")
check_function_exists(mach_task_self vt_has_mach_task_self)

set(CMAKE_REQUIRED_INCLUDES "ldms/ldms.h")
check_function_exists(ldms_h vt_has_ldms_h)

set(CMAKE_REQUIRED_INCLUDES "ldms/ldmsd_stream.h")
check_function_exists(ldmsd_stream_h vt_has_ldmsd_stream_h)

set(CMAKE_REQUIRED_INCLUDES "ovis_util/util.h")
check_function_exists(ovis_util_h vt_has_ovis_util_h)
24 changes: 18 additions & 6 deletions cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,25 @@ function(link_target_with_vt)
if (${ARG_DEBUG_LINK})
message(STATUS "link_target_with_vt: ldms=${vt_ldms_enabled}")
endif()
target_include_directories(${ARG_TARGET} SYSTEM PUBLIC
${vt_ldms_includes}
)
target_link_directories(${ARG_TARGET} PUBLIC ${vt_ldms_libs})
if(${vt_ldms_includes})
message(STATUS "Using user provided vt_ldms_includes=${vt_ldms_includes}")
target_include_directories(${ARG_TARGET} SYSTEM PUBLIC
${vt_ldms_includes}
)
else()
message(STATUS "vt_ldms_includes CMake variable not set")
endif()

if(${vt_ldms_libs})
target_link_directories(${ARG_TARGET} PUBLIC ${vt_ldms_libs})
message(STATUS "Using user provided vt_ldms_libs=${vt_ldms_libs}")
else()
message(STATUS "vt_ldms_libs CMake variable not set")
endif()

target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} :libldms.so :libldmsd_stream.so
)
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} :libldms.so :libldmsd_stream.so
)
endif()

if (${ARG_CUSTOM_LINK_ARGS})
Expand Down

0 comments on commit 1e0716e

Please sign in to comment.