diff --git a/CMakeLists.txt b/CMakeLists.txt index 08a2d9d59..63cbd229e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ else() endif() option(CRASHPAD_ZLIB_SYSTEM "Use system zlib library" "${CRASHPAD_ZLIB_SYSTEM_DEFAULT}") -if(CRASHPAD_ZLIB_SYSTEM) +if(CRASHPAD_ZLIB_SYSTEM AND NOT ZLIB_FOUND) find_package(ZLIB REQUIRED) endif() diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 02ff865a4..b9161b475 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -253,18 +253,7 @@ if(LINUX OR ANDROID) find_package(CURL REQUIRED) endif() - if(TARGET CURL::libcurl) # Only available in cmake 3.12+ - target_link_libraries(crashpad_util PRIVATE CURL::libcurl) - else() - # Needed for cmake < 3.12 support (cmake 3.12 introduced the target CURL::libcurl) - target_include_directories(crashpad_util PRIVATE ${CURL_INCLUDE_DIR}) - # The exported sentry target must not contain any path of the build machine, therefore use generator expressions - string(REPLACE ";" "$" GENEX_CURL_LIBRARIES "${CURL_LIBRARIES}") - string(REPLACE ";" "$" GENEX_CURL_COMPILE_DEFINITIONS "${CURL_COMPILE_DEFINITIONS}") - target_link_libraries(crashpad_util PRIVATE $) - target_compile_definitions(crashpad_util PRIVATE $) - endif() - + target_link_libraries(crashpad_util PRIVATE CURL::libcurl) SET(HTTP_TRANSPORT_IMPL net/http_transport_libcurl.cc) else() find_package(OpenSSL)