Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ option(DDPROF_ALLOCATOR "Define the type of allocator (STANDARD / JEMALLOC)" STA
option(BUILD_BENCHMARKS "Enable benchmarks" OFF)
option(BUILD_DDPROF_TESTING "Enable tests" ON)
option(STRIP_DEBUG_INFO "Strip debug info from the final binaries" OFF)
option(DDPROF_FETCH_LIBDATADOG "Download libdatadog from GitHub releases" ON)

if(USE_LOADER AND USE_AUXILIARY)
message(FATAL_ERROR "USE_LOADER and USE_AUXILIARY are incompatible")
Expand Down
15 changes: 10 additions & 5 deletions cmake/Findlibdatadog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ set(TAG_LIBDATADOG

set(Datadog_ROOT ${VENDOR_PATH}/libdatadog-${TAG_LIBDATADOG})

message(STATUS "${CMAKE_SOURCE_DIR}/tools/fetch_libddprof.sh ${TAG_LIBDATADOG} ${LIBDATADOG_ROOT}")
execute_process(
COMMAND "${CMAKE_SOURCE_DIR}/tools/fetch_libdatadog.sh" ${TAG_LIBDATADOG} ${Datadog_ROOT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND_ERROR_IS_FATAL ANY)
if(DDPROF_FETCH_LIBDATADOG)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are changes in https://github.com/DataDog/ddprof/pull/504/changes enough to point to a relevant libdatadog install ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an option to iterate locally on libdatadog changes, though maybe this fits both use cases ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm, our use case is slightly different: Conan injects find_package config through CMAKE_PREFIX_PATH, so there's no single path to set Datadog_LOCAL_ROOT to.

If #504 also sets DataDog_DIR unconditionally (outside the if), then find_package(Datadog) would find it through standard search paths and both use cases would be covered.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I'll adjust after #504 is in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think we can close this one!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't mind proposing something with a test, It would guarantee that it suits your requirements.

message(STATUS "${CMAKE_SOURCE_DIR}/tools/fetch_libddprof.sh ${TAG_LIBDATADOG} ${LIBDATADOG_ROOT}")
execute_process(
COMMAND "${CMAKE_SOURCE_DIR}/tools/fetch_libdatadog.sh" ${TAG_LIBDATADOG} ${Datadog_ROOT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND_ERROR_IS_FATAL ANY)

set(DataDog_DIR "${Datadog_ROOT}/cmake")
set(DataDog_DIR "${Datadog_ROOT}/cmake")
endif()

# When DDPROF_FETCH_LIBDATADOG=OFF, the consumer must provide Datadog through
# CMAKE_PREFIX_PATH or a CMake config generator (e.g. Conan CMakeDeps).

# Prefer static library to shared library
set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
Expand Down