Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 1 | From 65923a872e44cb461ef1a03374057351f0bc5efe Mon Sep 17 00:00:00 2001 |
| 2 | From: Yi Zhao <yi.zhao@windriver.com> |
| 3 | Date: Tue, 19 Mar 2024 19:39:04 +0800 |
| 4 | Subject: [PATCH] Do not use bundled packages |
| 5 | |
| 6 | Use external dependencies for openssl, curl, bzip2, zlib, libarchive, |
| 7 | xz, yaml-cpp and libxml2. |
| 8 | |
| 9 | Upstream-Status: Inappropriate [embedded specific] |
| 10 | |
| 11 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> |
| 12 | --- |
| 13 | CMakeLists.txt | 23 ++++++----------------- |
| 14 | extensions/libarchive/CMakeLists.txt | 7 ++----- |
| 15 | 2 files changed, 8 insertions(+), 22 deletions(-) |
| 16 | |
| 17 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 18 | index 13a2b992..8a1dd6d9 100644 |
| 19 | --- a/CMakeLists.txt |
| 20 | +++ b/CMakeLists.txt |
| 21 | @@ -222,9 +222,7 @@ else() |
| 22 | endif() |
| 23 | |
| 24 | if (NOT DISABLE_BZIP2 AND (NOT DISABLE_LIBARCHIVE OR (NOT DISABLE_ROCKSDB AND NOT WIN32))) |
| 25 | - include(BundledBZip2) |
| 26 | - use_bundled_bzip2(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) |
| 27 | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/bzip2/dummy") |
| 28 | + find_package(BZip2 REQUIRED) |
| 29 | endif() |
| 30 | |
| 31 | if(NOT WIN32) |
| 32 | @@ -247,9 +245,7 @@ endif() |
| 33 | |
| 34 | # OpenSSL |
| 35 | if (NOT OPENSSL_OFF) |
| 36 | - include(BundledOpenSSL) |
| 37 | - use_openssl("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}") |
| 38 | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/ssl") |
| 39 | + find_package(OpenSSL REQUIRED) |
| 40 | |
| 41 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOPENSSL_SUPPORT") |
| 42 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_SUPPORT") |
| 43 | @@ -262,9 +258,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSODIUM_STATIC=1") |
| 44 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSODIUM_STATIC=1") |
| 45 | |
| 46 | # zlib |
| 47 | -include(BundledZLIB) |
| 48 | -use_bundled_zlib(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 49 | -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/zlib/dummy") |
| 50 | +find_package(ZLIB REQUIRED) |
| 51 | |
| 52 | # uthash |
| 53 | add_library(ut INTERFACE) |
| 54 | @@ -272,9 +266,7 @@ target_include_directories(ut SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/thir |
| 55 | |
| 56 | # cURL |
| 57 | if(NOT DISABLE_CURL) |
| 58 | - include(BundledLibcURL) |
| 59 | - use_bundled_curl(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 60 | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/curl/dummy") |
| 61 | + find_package(CURL REQUIRED) |
| 62 | else() |
| 63 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDISABLE_CURL") |
| 64 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDISABLE_CURL") |
| 65 | @@ -285,8 +277,7 @@ include(BundledSpdlog) |
| 66 | use_bundled_spdlog(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 67 | |
| 68 | # yaml-cpp |
| 69 | -include(BundledYamlCpp) |
| 70 | -use_bundled_yamlcpp(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 71 | +find_package(yaml-cpp REQUIRED) |
| 72 | |
| 73 | # concurrentqueue |
| 74 | add_library(concurrentqueue INTERFACE) |
| 75 | @@ -357,9 +348,7 @@ include(Extensions) |
| 76 | add_subdirectory(libminifi) |
| 77 | |
| 78 | if ((ENABLE_OPENWSMAN AND NOT DISABLE_CIVET AND NOT DISABLE_CURL) OR ENABLE_ALL OR ENABLE_AZURE) |
| 79 | - include(BundledLibXml2) |
| 80 | - use_bundled_libxml2(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) |
| 81 | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/libxml2/dummy") |
| 82 | + find_package(LibXml2 REQUIRED) |
| 83 | endif() |
| 84 | |
| 85 | if (ENABLE_ALL OR ENABLE_PROMETHEUS OR NOT DISABLE_CIVET) |
| 86 | diff --git a/extensions/libarchive/CMakeLists.txt b/extensions/libarchive/CMakeLists.txt |
| 87 | index 2b89d3ea..49e13e21 100644 |
| 88 | --- a/extensions/libarchive/CMakeLists.txt |
| 89 | +++ b/extensions/libarchive/CMakeLists.txt |
| 90 | @@ -22,13 +22,10 @@ if (DISABLE_LIBARCHIVE) |
| 91 | endif() |
| 92 | |
| 93 | if (NOT DISABLE_LZMA) |
| 94 | - include(BundledLibLZMA) |
| 95 | - use_bundled_liblzma(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) |
| 96 | - list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/liblzma/dummy") |
| 97 | + find_package(LibLZMA REQUIRED) |
| 98 | endif() |
| 99 | |
| 100 | -include(BundledLibArchive) |
| 101 | -use_bundled_libarchive(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) |
| 102 | +find_package(LibArchive REQUIRED) |
| 103 | |
| 104 | include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt) |
| 105 | |
| 106 | -- |
| 107 | 2.25.1 |
| 108 | |