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 authored and lifflander committed Nov 9, 2023
1 parent 4bfd0ae commit 0768439
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 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)
13 changes: 11 additions & 2 deletions cmake/configure_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,17 @@ endif()

if (${vt_ldms_enabled})
message(STATUS "LDMS enabled")
message(STATUS "LDMS: vt_ldms_includes:${vt_ldms_includes}")
message(STATUS "LDMS: vt_ldms_libs:${vt_ldms_libs}")
if(${vt_ldms_includes})
message(STATUS "Using user provided vt_ldms_includes=${vt_ldms_includes}")
else()
message(STATUS "vt_ldms_includes CMake variable not set")
endif()
if(${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()

set(vt_feature_cmake_ldms "1")
else()
message(STATUS "LDMS disabled")
Expand Down
19 changes: 13 additions & 6 deletions cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,20 @@ 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})
target_include_directories(${ARG_TARGET} SYSTEM PUBLIC
${vt_ldms_includes}
)
endif()

if(${vt_ldms_libs})
target_link_directories(${ARG_TARGET} PUBLIC ${vt_ldms_libs})
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 0768439

Please sign in to comment.