Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
873ab1d
windows builds ddup
taegyunkim Jan 24, 2025
7e383a7
hack to download dd for windows
taegyunkim Jan 24, 2025
cb625a9
typo
taegyunkim Jan 24, 2025
d8b02f7
remove newlines
taegyunkim Jan 24, 2025
54a2e01
remove quotes
taegyunkim Jan 24, 2025
ff84724
use fetch content
taegyunkim Jan 27, 2025
f080999
comment out crashtracker for windows
taegyunkim Jan 27, 2025
95be2b7
compiles on windows
taegyunkim Jan 28, 2025
7804dab
format
taegyunkim Jan 28, 2025
5f2ced3
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Jan 31, 2025
bf89fb0
no format
taegyunkim Jan 31, 2025
ab299af
update
taegyunkim Jan 31, 2025
3837c7d
compile/link options
taegyunkim Jan 31, 2025
ae84cb0
format
taegyunkim Jan 31, 2025
b351f4b
enable for 32bit windows
taegyunkim Jan 31, 2025
12f7866
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Jan 31, 2025
18395b2
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Jan 31, 2025
1c493fd
have 64bit check again
taegyunkim Jan 31, 2025
18b72f4
just delete cp37
taegyunkim Jan 31, 2025
8e49e8b
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Jan 31, 2025
6d33703
typo
taegyunkim Jan 31, 2025
0acc556
remove 3.7
taegyunkim Jan 31, 2025
da60583
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Jan 31, 2025
b165e95
enable libdd export for windows
taegyunkim Jan 31, 2025
689063d
_WIN32 is sufficient to check for windows
taegyunkim Jan 31, 2025
dabd7ca
remove unnecessary debug prints
taegyunkim Jan 31, 2025
590b042
add notes
taegyunkim Jan 31, 2025
69cf6a1
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Feb 3, 2025
2bce602
copy change from libdatadog
taegyunkim Feb 4, 2025
238d262
Merge branch '3.x-staging' into taegyunkim/prof-11194-windows-libdd
taegyunkim Feb 4, 2025
b969696
fix typo
taegyunkim Feb 4, 2025
96fe424
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Feb 6, 2025
0799447
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 21, 2025
eda8412
compile flags
taegyunkim Mar 21, 2025
70cc081
format
taegyunkim Mar 21, 2025
8e34ef3
fix if/else/endif
taegyunkim Mar 21, 2025
3032959
reorder to minimize diff
taegyunkim Mar 21, 2025
96346dc
c++20 for windows
taegyunkim Mar 21, 2025
b2f6a52
Discard changes to ddtrace/internal/datadog/profiling/dd_wrapper/incl…
taegyunkim Mar 21, 2025
12efee8
use named initialization
taegyunkim Mar 21, 2025
0580aa7
cmake format
taegyunkim Mar 21, 2025
a96e54a
add windows checksums
taegyunkim Mar 21, 2025
9bf6915
fix format
taegyunkim Mar 21, 2025
4657aa3
Discard changes to ddtrace/internal/datadog/profiling/stack_v2/src/sa…
taegyunkim Mar 21, 2025
11bd606
Discard changes to ddtrace/internal/datadog/profiling/dd_wrapper/src/…
taegyunkim Mar 21, 2025
4f6eced
use and keyword
taegyunkim Mar 21, 2025
2b433bb
builds on windows
taegyunkim Mar 22, 2025
4a8c43b
format
taegyunkim Mar 22, 2025
44a8214
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 24, 2025
22fbf05
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 24, 2025
f67f2d0
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 25, 2025
40b08f1
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 25, 2025
42a9ead
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 25, 2025
2e2721c
relnote
taegyunkim Mar 25, 2025
dfd6b6d
fix comment
taegyunkim Mar 31, 2025
2049e74
update comment
taegyunkim Mar 31, 2025
308d127
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Mar 31, 2025
194ea56
Merge branch 'main' into taegyunkim/prof-11194-windows-libdd
taegyunkim Apr 1, 2025
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
139 changes: 89 additions & 50 deletions ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,66 @@ function(add_ddup_config target)
# standard. This isn't currently a problem, but if it becomes one, we may have to structure the library differently.
target_compile_features(${target} PUBLIC cxx_std_17)

# Common compile options
target_compile_options(
${target}
PRIVATE "$<$<CONFIG:Release>:-Os>"
-ffunction-sections
-Wall
-Werror
-Wextra
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS-specific options
target_compile_options(${target} PRIVATE "$<$<CONFIG:Debug>:-Og;-g>" "$<$<CONFIG:RelWithDebInfo>:-Os;-g>")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Named struct initialization is supported in C++20, but clang/gcc also support it in C++17 MSVC doesn't support
# it until C++20.
target_compile_features(${target} PUBLIC cxx_std_20)
target_compile_options(
${target}
PRIVATE "$<$<CONFIG:Release>:/O1>" # Optimize for size (equivalent to -Os)
/Gy # Enable function-level linking (similar to -ffunction-sections)
/W4 # Highest warning level (equivalent to -Wall -Wextra)
/WX # Treat warnings as errors (equivalent to -Werror)
/w44265 # Warn on shadowed variables (equivalent to -Wshadow)
/w44287 # Warn on missing virtual destructors (equivalent to -Wnon-virtual-dtor)
/w44412 # Warn on old-style casts (equivalent to -Wold-style-cast)
/wd4201 # Don't treat the following as an error C4201: nonstandard extension used: nameless
# struct/union
/wd4267 # conversion from 'size_t' to 'unsigned short', possible loss of data
/wd4996 # 'getpid': The POSIX name for this item is deprecated. Instead, use the ISO C and C++
# conformant name: _getpid.
/wd4100 # '_unusedop': unreferenced formal parameter
/wd4245 # conversion from 'int' to 'uint64_t'
/wd4244 # conversion from 'int64_t' to 'int'
/wd4551)
else()
# Non-macOS (e.g., Linux) options
target_compile_options(${target} PRIVATE "$<$<CONFIG:Debug>:-Og;-ggdb3>"
"$<$<CONFIG:RelWithDebInfo>:-Os;-ggdb3>" -fno-semantic-interposition)
# Common compile options
target_compile_options(
${target}
PRIVATE "$<$<CONFIG:Release>:-Os>"
-ffunction-sections
-Wall
-Werror
-Wextra
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS-specific options
target_compile_options(${target} PRIVATE "$<$<CONFIG:Debug>:-Og;-g>" "$<$<CONFIG:RelWithDebInfo>:-Os;-g>")
else()
# Non-macOS (e.g., Linux) options
target_compile_options(
${target} PRIVATE "$<$<CONFIG:Debug>:-Og;-ggdb3>" "$<$<CONFIG:RelWithDebInfo>:-Os;-ggdb3>"
-fno-semantic-interposition)
endif()
endif()

# Common link options
target_link_options(${target} PRIVATE "$<$<CONFIG:RelWithDebInfo>:>")

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_options(
${target}
PRIVATE
"$<$<CONFIG:Release>:/OPT:REF>" # Equivalent to --gc-sections
# Disable incremental linking mainly to reduce the binary size
# https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170#remarks
"$<$<CONFIG:Release>:/INCREMENTAL:NO>"
"/NODEFAULTLIB:ALL" # Rough equivalent of --exclude-libs,ALL
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS-specific linker options
target_link_options(${target} PRIVATE "$<$<CONFIG:Release>:-Wl,-dead_strip>")
target_link_options(${target} PRIVATE -ldl -undefined dynamic_lookup)
Expand All @@ -46,43 +81,47 @@ function(add_ddup_config target)
-Wl,--exclude-libs,ALL)
endif()

# If we can IPO, then do so
check_ipo_supported(RESULT result)
# Don't do any complications for Windows for now
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
# If we can IPO, then do so
check_ipo_supported(RESULT result)

if(result)
set_property(TARGET ${target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
if(result)
set_property(TARGET ${target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

# Propagate sanitizers
if(SANITIZE_OPTIONS)
# Some sanitizers (or the analysis--such as symbolization--tooling thereof) work better with frame pointers, so
# we include it here.
target_compile_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS} -fno-omit-frame-pointer)
target_link_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS} -shared-libsan)
# Propagate sanitizers
if(SANITIZE_OPTIONS)
# Some sanitizers (or the analysis--such as symbolization--tooling thereof) work better with frame pointers,
# so we include it here.
target_compile_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS} -fno-omit-frame-pointer)
target_link_options(${target} PRIVATE -fsanitize=${SANITIZE_OPTIONS} -shared-libsan)

# Locate all directories containing relevant `.so` files
execute_process(
COMMAND bash -c "find $(${CMAKE_CXX_COMPILER} -print-file-name=) -name '*.so' -exec dirname {} \; | uniq"
OUTPUT_VARIABLE LIBSAN_LIB_PATHS
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY)
# Locate all directories containing relevant `.so` files
execute_process(
COMMAND bash -c
"find $(${CMAKE_CXX_COMPILER} -print-file-name=) -name '*.so' -exec dirname {} \; | uniq"
OUTPUT_VARIABLE LIBSAN_LIB_PATHS
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY)

# Print for debugging
message(STATUS "LIBSAN_LIB_PATHS: ${LIBSAN_LIB_PATHS}")
# Print for debugging
message(STATUS "LIBSAN_LIB_PATHS: ${LIBSAN_LIB_PATHS}")

# Split the paths into a semicolon-separated list for CMake
string(REPLACE "\n" ";" LIBSAN_LIB_PATHS_LIST "${LIBSAN_LIB_PATHS}")
# Split the paths into a semicolon-separated list for CMake
string(REPLACE "\n" ";" LIBSAN_LIB_PATHS_LIST "${LIBSAN_LIB_PATHS}")

# Set RPATH to include all identified paths
set_target_properties(${target} PROPERTIES BUILD_RPATH "${LIBSAN_LIB_PATHS_LIST}" INSTALL_RPATH
"${LIBSAN_LIB_PATHS_LIST}")
endif()
# Set RPATH to include all identified paths
set_target_properties(${target} PROPERTIES BUILD_RPATH "${LIBSAN_LIB_PATHS_LIST}"
INSTALL_RPATH "${LIBSAN_LIB_PATHS_LIST}")
endif()

# If DO_FANALYZER is specified and we're using gcc, then we can use -fanalyzer
if(DO_FANALYZER AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${target} PRIVATE -fanalyzer)
endif()
# If DO_FANALYZER is specified and we're using gcc, then we can use -fanalyzer
if(DO_FANALYZER AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${target} PRIVATE -fanalyzer)
endif()

# The main targets, ddup, crashtracker, stack_v2, and dd_wrapper are built as dynamic libraries, so PIC is required.
# And setting this is also fine for tests as they're loading those dynamic libraries.
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
# The main targets, ddup, crashtracker, stack_v2, and dd_wrapper are built as dynamic libraries, so PIC is
# required. And setting this is also fine for tests as they're loading those dynamic libraries.
set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
endfunction()
49 changes: 39 additions & 10 deletions ddtrace/internal/datadog/profiling/cmake/FindLibdatadog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,24 @@ if(NOT DEFINED DD_CHECKSUMS)
"63ace200493cd8e108be11cbf5ba19b5bd9a2e1cb730bdefd0a14ae217b716f5 libdatadog-i686-unknown-linux-gnu.tar.gz"
"8e09afd3cfb5ace85501f37b4bd6378299ebbf71189ccc2173169998b75b4b56 libdatadog-x86_64-alpine-linux-musl.tar.gz"
"ced5db61e0ca8e974b9d59b0b6833c28e19445a3e4ec3c548fda965806c17560 libdatadog-x86_64-apple-darwin.tar.gz"
"caaec84fc9afbcb3ec4618791b3c3f1ead65196009e9f07fd382e863dc3bdc66 libdatadog-x86_64-unknown-linux-gnu.tar.gz")
"caaec84fc9afbcb3ec4618791b3c3f1ead65196009e9f07fd382e863dc3bdc66 libdatadog-x86_64-unknown-linux-gnu.tar.gz"
"3ec847560bd1de86935c230f34cb58d2a0f3f17865349d094e18d3e8edf8518955ede05bf595dc3ca41f99a911760f891bcf58d92fc5c06ce6ad98cdc8f034e3 libdatadog-x64-windows.zip"
"2d884d76a35e4c37d05f6902c16b9e08ce1565976a6c9cf5fbd30273d8bd5385ad2523658eebadb02f90543191e217b028e86722ae7bcc08cbca2c342a5b5e79 libdatadog-x86-windows.zip"
)
endif()

# Determine platform-specific tarball name in a way that conforms to the libdatadog naming scheme in Github releases
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
set(DD_ARCH "aarch64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
set(DD_ARCH "x86_64")
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

set(DD_EXT "tar.gz")
set(DD_HASH_ALGO "SHA256")

if(APPLE)
set(DD_PLATFORM "apple-darwin")
elseif(UNIX)
Expand All @@ -50,16 +56,29 @@ elseif(UNIX)
OUTPUT_VARIABLE LDD_OUTPUT
ERROR_VARIABLE LDD_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(LDD_OUTPUT MATCHES "musl")
set(DD_PLATFORM "alpine-linux-musl")
else()
set(DD_PLATFORM "unknown-linux-gnu")
endif()
elseif(WIN32)
# WIN32 is True when it's Windows, including Win64
set(DD_PLATFORM "windows")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(DD_ARCH "x64")
else()
set(DD_ARCH "x86")
endif()

set(DD_EXT "zip")
set(DD_HASH_ALGO "SHA512")
else()
message(FATAL_ERROR "Unsupported operating system")
endif()

set(DD_TARBALL "libdatadog-${DD_ARCH}-${DD_PLATFORM}.tar.gz")
set(DD_TARBALL "libdatadog-${DD_ARCH}-${DD_PLATFORM}.${DD_EXT}")

# Make sure we can get the checksum for the tarball
foreach(ENTRY IN LISTS DD_CHECKSUMS)
Expand All @@ -75,10 +94,15 @@ endif()

# Clean up any existing downloads if they exist
set(TARBALL_PATH "${FETCHCONTENT_DOWNLOADS_DIR}/${DD_TARBALL}")

set(LIBDATADOG_URL "https://github.com/DataDog/libdatadog/releases/download/${TAG_LIBDATADOG}/${DD_TARBALL}")

if(EXISTS "${TARBALL_PATH}")
file(SHA256 "${TARBALL_PATH}" EXISTING_HASH)
file(${DD_HASH_ALGO} "${TARBALL_PATH}" EXISTING_HASH)

if(NOT EXISTING_HASH STREQUAL DD_HASH)
file(REMOVE "${TARBALL_PATH}")

# Also remove the subbuild directory to force a fresh download
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/_deps/libdatadog-subbuild")
endif()
Expand All @@ -87,23 +111,28 @@ endif()
# Use FetchContent to download and extract the library
FetchContent_Declare(
libdatadog
URL "https://github.com/DataDog/libdatadog/releases/download/${TAG_LIBDATADOG}/${DD_TARBALL}"
URL_HASH SHA256=${DD_HASH}
URL ${LIBDATADOG_URL}
URL_HASH ${DD_HASH_ALGO}=${DD_HASH}
DOWNLOAD_DIR "${FETCHCONTENT_DOWNLOADS_DIR}" SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/libdatadog-src")

# Make the content available
FetchContent_MakeAvailable(libdatadog)

# Set up paths
get_filename_component(Datadog_ROOT "${libdatadog_SOURCE_DIR}" ABSOLUTE)
set(ENV{Datadog_ROOT} "${Datadog_ROOT}")
set(Datadog_DIR "${Datadog_ROOT}/cmake")

# Configure library preferences (static over shared)
set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
if(NOT WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()

# Find the package
find_package(Datadog REQUIRED)

# Restore library preferences
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP})
if(NOT WIN32)
# Restore library preferences
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP})
endif()
88 changes: 57 additions & 31 deletions ddtrace/internal/datadog/profiling/dd_wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ get_filename_component(dd_wrapper_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ddtr
# Custom modules are in the parent directory
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

if(MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(BUILD_SHARED_LIBS TRUE)
endif()

# Includes
include(AnalysisFunc)
include(FindClangtidy)
Expand All @@ -33,35 +38,54 @@ set(Datadog_LIBRARIES
${Datadog_LIBRARIES}
PARENT_SCOPE)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if(NOT Threads_FOUND OR NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "pthread compatible library not found")
if(WIN32)
# Library sources
add_library(
dd_wrapper SHARED
src/code_provenance.cpp
src/code_provenance_interface.cpp
src/ddup_interface.cpp
src/profile.cpp
src/sample.cpp
src/sample_manager.cpp
src/synchronized_sample_pool.cpp
src/uploader.cpp
src/uploader_builder.cpp)
else()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

if(NOT Threads_FOUND OR NOT CMAKE_USE_PTHREADS_INIT)
message(FATAL_ERROR "pthread compatible library not found")
endif()

# Library sources
add_library(
dd_wrapper SHARED
src/code_provenance.cpp
src/code_provenance_interface.cpp
src/crashtracker.cpp
src/crashtracker_interface.cpp
src/ddup_interface.cpp
src/profile.cpp
src/receiver_interface.cpp
src/sample.cpp
src/sample_manager.cpp
src/synchronized_sample_pool.cpp
src/uploader.cpp
src/uploader_builder.cpp)
endif()

# Library sources
add_library(
dd_wrapper SHARED
src/code_provenance.cpp
src/code_provenance_interface.cpp
src/crashtracker.cpp
src/crashtracker_interface.cpp
src/ddup_interface.cpp
src/profile.cpp
src/receiver_interface.cpp
src/sample.cpp
src/sample_manager.cpp
src/synchronized_sample_pool.cpp
src/uploader.cpp
src/uploader_builder.cpp)

# Add common configuration flags
add_ddup_config(dd_wrapper)

target_include_directories(dd_wrapper PRIVATE include ${Datadog_INCLUDE_DIRS})

target_link_libraries(dd_wrapper PRIVATE ${Datadog_LIBRARIES} Threads::Threads)
if(WIN32)
target_link_libraries(dd_wrapper PRIVATE Datadog::Profiling)
else()
target_link_libraries(dd_wrapper PRIVATE Datadog::Profiling Threads::Threads)
endif()

# Figure out the suffix. Try to approximate the cpython way of doing things.
check_symbol_exists(__GLIBC__ "features.h" HAVE_GLIBC)
Expand All @@ -87,17 +111,19 @@ set(DD_WRAPPER_TARGET_NAME "dd_wrapper-${PLATFORM_SUFFIX}")

set_target_properties(dd_wrapper PROPERTIES OUTPUT_NAME "${DD_WRAPPER_TARGET_NAME}")

# The name of the crashtracker executable has to be propagated to a a few different targets, and it needs to be inferred
# at runtime, so we set it here. Any component which used dd_wrapper will have access to a uniform name.
set(CRASHTRACKER_EXE_BASE_NAME "crashtracker_exe")
set(CRASHTRACKER_EXE_TARGET_NAME ${CRASHTRACKER_EXE_BASE_NAME}-${PLATFORM_SUFFIX})
if(NOT WIN32)
# The name of the crashtracker executable has to be propagated to a a few different targets, and it needs to be
# inferred at runtime, so we set it here. Any component which used dd_wrapper will have access to a uniform name.
set(CRASHTRACKER_EXE_BASE_NAME "crashtracker_exe")
set(CRASHTRACKER_EXE_TARGET_NAME ${CRASHTRACKER_EXE_BASE_NAME}-${PLATFORM_SUFFIX})

target_compile_definitions(dd_wrapper PRIVATE CRASHTRACKER_EXE_TARGET_NAME="${CRASHTRACKER_EXE_TARGET_NAME}")
target_compile_definitions(dd_wrapper PRIVATE CRASHTRACKER_EXE_TARGET_NAME="${CRASHTRACKER_EXE_TARGET_NAME}")

# Also propagate the target name to the parent scope, since it can be used for non-code purposes (e.g., filenames)
set(CRASHTRACKER_EXE_TARGET_NAME
${CRASHTRACKER_EXE_TARGET_NAME}
PARENT_SCOPE)
# Also propagate the target name to the parent scope, since it can be used for non-code purposes (e.g., filenames)
set(CRASHTRACKER_EXE_TARGET_NAME
${CRASHTRACKER_EXE_TARGET_NAME}
PARENT_SCOPE)
endif()

# For a regular build, the LIB_INSTALL_DIR represents the final location of the library, so nothing special is needed.
# However, for an inplace build, setup.py will pass a temporary path as the extension output directory, so while it will
Expand Down
Loading
Loading