@@ -38,10 +38,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
3838 endif ()
3939endif ()
4040
41- include (ProcessorCount)
42- ProcessorCount(NUM_PROCESSORS)
43- set (MAKE_JOB_COUNT ${NUM_PROCESSORS} CACHE STRING "Number of jobs to use when building libcurl" )
44-
4541function (add_sanitizers)
4642 add_compile_options (-fsanitize=address)
4743 add_link_options (-fsanitize=address)
@@ -64,17 +60,7 @@ if (BUILD_TESTING)
6460 set (CMAKE_BUILD_TYPE "Debug" )
6561endif ()
6662
67- include (ExternalProject)
68- ExternalProject_Add(curl
69- URL "https://github.com/curl/curl/releases/download/curl-7_85_0/curl-7.85.0.tar.gz"
70- URL_MD5 "4e9eb4f434e9be889e510f038754d3de"
71- BUILD_IN_SOURCE 1
72- DOWNLOAD_EXTRACT_TIMESTAMP 0
73- SOURCE_DIR ${CMAKE_BINARY_DIR} /curl
74- CONFIGURE_COMMAND ${CMAKE_BINARY_DIR} /curl/configure --prefix =${CMAKE_BINARY_DIR} --disable-ftp --disable-ldap --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-smtp --disable-gopher --without-ssl --disable-crypto-auth --without-axtls --without-zlib --disable-rtsp --enable-shared=no --enable-static =yes --with-pic --without-brotli --without-libidn2
75- BUILD_COMMAND make -j${MAKE_JOB_COUNT}
76- INSTALL_COMMAND make install
77- )
63+ include (cmake/curl.cmake)
7864
7965if (APPLE )
8066 find_library (COREFOUNDATION_LIBRARY CoreFoundation)
@@ -206,16 +192,13 @@ target_sources(dd_trace_cpp-objects PUBLIC
206192 src/datadog/w3c_propagation.h
207193)
208194
209- add_dependencies (dd_trace_cpp-objects curl)
210-
211- # Make the build libcurl visible.
212- include_directories (${CMAKE_BINARY_DIR} /include )
195+ add_dependencies (dd_trace_cpp-objects libcurl)
213196
214197# Linking this library requires libcurl and threads.
215198find_package (Threads REQUIRED)
216199target_link_libraries (dd_trace_cpp-objects
217200 PUBLIC
218- ${CMAKE_BINARY_DIR} /lib/ libcurl.a
201+ libcurl
219202 PUBLIC
220203 Threads::Threads
221204 ${COVERAGE_LIBRARIES}
0 commit comments