Skip to content

Commit

Permalink
Change profiler to use the sofile instead
Browse files Browse the repository at this point in the history
  • Loading branch information
gleocadie committed Nov 18, 2024
1 parent bd8f5d5 commit c233d22
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions build/cmake/FindLibdatadog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,28 @@ endif()

set(LIBDATADOG_BASE_DIR ${libdatadog-${LIBDATADOG_VERSION}_SOURCE_DIR})

add_library(libdatadog-lib STATIC IMPORTED)
add_library(libdatadog-lib SHARED IMPORTED)

set_target_properties(libdatadog-lib PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBDATADOG_BASE_DIR}/include
IMPORTED_LOCATION ${LIBDATADOG_BASE_DIR}/lib/libdatadog_profiling.a
IMPORTED_LOCATION ${LIBDATADOG_BASE_DIR}/lib/libdatadog_profiling.so
)

add_dependencies(libdatadog-lib libdatadog-${LIBDATADOG_VERSION})

# Override target_link_libraries
function(target_link_libraries target)
# Call the original target_link_libraries
_target_link_libraries(${ARGV})

if("libdatadog-lib" IN_LIST ARGN)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:libdatadog-lib>
$<TARGET_FILE_DIR:${target}>
COMMENT "Copying libdatadog to ${target} output directory"
)
endif()
endfunction()

0 comments on commit c233d22

Please sign in to comment.