Skip to content

Commit e78c035

Browse files
committed
Use existing helper to find dep modules for libarchive
1 parent f61890b commit e78c035

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

components/core/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ validate_compiler_versions()
1212
# Include options for CLP build
1313
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Options/options.cmake")
1414

15+
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/FindLibraryDependencies.cmake")
16+
1517
validate_and_setup_all_clp_dependency_flags()
1618
convert_clp_dependency_properties_to_variables()
1719

@@ -224,6 +226,10 @@ if(CLP_NEED_LIBARCHIVE)
224226
endif()
225227
find_package(LibArchive 3.8.1 REQUIRED)
226228
message(STATUS "Found LibArchive ${LibArchive_VERSION}")
229+
set(LibArchive_STATIC_LIBS "lzma")
230+
FindStaticLibraryDependencies(archive LibArchive "${LibArchive_STATIC_LIBS}")
231+
set(LibArchive_DYNAMIC_LIBS "bz2;lz4;z")
232+
FindDynamicLibraryDependencies(LibArchive "${LibArchive_DYNAMIC_LIBS}")
227233
endif()
228234

229235
# Find and setup libcurl
@@ -346,7 +352,6 @@ endif()
346352
# sqlite dependencies
347353
if(CLP_NEED_SQLITE)
348354
set(sqlite_DYNAMIC_LIBS "dl;m;pthread")
349-
include(cmake/Modules/FindLibraryDependencies.cmake)
350355
FindDynamicLibraryDependencies(sqlite "${sqlite_DYNAMIC_LIBS}")
351356
endif()
352357

@@ -759,7 +764,6 @@ if(CLP_BUILD_TESTING)
759764
target_link_libraries(unitTest
760765
PRIVATE
761766
${CURL_LIBRARIES}
762-
${LIBLZMA_LIBRARIES}
763767
${MONGOCXX_TARGET}
764768
${sqlite_LIBRARY_DEPENDENCIES}
765769
${STD_FS_LIBS}
@@ -775,7 +779,7 @@ if(CLP_BUILD_TESTING)
775779
date::date
776780
fmt::fmt
777781
LibArchive::LibArchive
778-
LZ4::LZ4
782+
${LibArchive_LIBRARY_DEPENDENCIES}
779783
log_surgeon::log_surgeon
780784
MariaDBClient::MariaDBClient
781785
nlohmann_json::nlohmann_json

components/core/src/clp/clp/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,21 @@ if(CLP_BUILD_EXECUTABLES)
174174
)
175175
target_link_libraries(clp
176176
PRIVATE
177-
${LIBLZMA_LIBRARIES}
178177
${sqlite_LIBRARY_DEPENDENCIES}
179178
${STD_FS_LIBS}
180179
Boost::filesystem Boost::program_options
181180
clp::string_utils
182181
date::date
183182
fmt::fmt
184183
LibArchive::LibArchive
185-
# BZip2 must be linked after static LibArchive for musllinux
186-
BZip2::BZip2
184+
${LibArchive_LIBRARY_DEPENDENCIES}
187185
log_surgeon::log_surgeon
188-
LZ4::LZ4
189186
MariaDBClient::MariaDBClient
190187
nlohmann_json::nlohmann_json
191188
spdlog::spdlog
192189
yaml-cpp
193190
ystdlib::containers
194191
ystdlib::error_handling
195-
ZLIB::ZLIB
196192
ZStd::ZStd
197193
)
198194
# Put the built executable at the root of the build directory

components/core/src/glt/glt/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,14 @@ if(CLP_BUILD_EXECUTABLES)
180180
)
181181
target_link_libraries(glt
182182
PRIVATE
183-
${LIBLZMA_LIBRARIES}
184183
${sqlite_LIBRARY_DEPENDENCIES}
185184
${STD_FS_LIBS}
186185
Boost::filesystem Boost::iostreams Boost::program_options
187186
clp::string_utils
188187
date::date
189188
fmt::fmt
190189
LibArchive::LibArchive
191-
LZ4::LZ4
190+
${LibArchive_LIBRARY_DEPENDENCIES}
192191
MariaDBClient::MariaDBClient
193192
nlohmann_json::nlohmann_json
194193
spdlog::spdlog

0 commit comments

Comments
 (0)