2023-10-31 15:31:57 -04:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-02-15 08:39:09 +01:00
|
|
|
index 70839abd..cb3b5d8f 100644
|
2023-10-31 15:31:57 -04:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-02-15 08:39:09 +01:00
|
|
|
@@ -184,12 +184,9 @@ endif()
|
2024-02-05 19:11:53 -06:00
|
|
|
|
2024-02-15 08:39:09 +01:00
|
|
|
if (ENABLE_DECOMPRESSION)
|
|
|
|
# Zlib and ZSTD need to be found otherwise disable it
|
|
|
|
- if(NOT TARGET ZLIB::ZLIB)
|
|
|
|
- find_package(ZLIB)
|
|
|
|
- endif()
|
|
|
|
- if(NOT TARGET ZSTD::ZSTD)
|
|
|
|
- find_package(ZSTD)
|
|
|
|
- endif()
|
|
|
|
+ find_package(ZLIB REQUIRED)
|
|
|
|
+ find_package(zstd CONFIG REQUIRED)
|
|
|
|
+ set(ZSTD_FOUND TRUE)
|
|
|
|
if (ZLIB_FOUND AND ZSTD_FOUND )
|
|
|
|
set(HAVE_ZLIB TRUE)
|
|
|
|
set(HAVE_ZLIB_H TRUE)
|
2024-02-05 19:11:53 -06:00
|
|
|
diff --git a/src/lib/libdwarf/CMakeLists.txt b/src/lib/libdwarf/CMakeLists.txt
|
2024-02-15 08:39:09 +01:00
|
|
|
index 7500c9f4..faf1bd7a 100644
|
2024-02-05 19:11:53 -06:00
|
|
|
--- a/src/lib/libdwarf/CMakeLists.txt
|
|
|
|
+++ b/src/lib/libdwarf/CMakeLists.txt
|
|
|
|
@@ -105,7 +105,7 @@ target_include_directories(dwarf PUBLIC
|
2024-02-15 08:39:09 +01:00
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libdwarf>
|
2024-02-05 19:11:53 -06:00
|
|
|
)
|
|
|
|
if(ZLIB_FOUND AND ZSTD_FOUND)
|
|
|
|
- target_link_libraries(dwarf PRIVATE ZLIB::ZLIB ZSTD::ZSTD )
|
2024-02-15 08:39:09 +01:00
|
|
|
+ target_link_libraries(dwarf PRIVATE ZLIB::ZLIB $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static> )
|
2024-02-05 19:11:53 -06:00
|
|
|
endif()
|
|
|
|
set_target_properties(dwarf PROPERTIES PUBLIC_HEADER "libdwarf.h;dwarf.h")
|
|
|
|
|
|
|
|
|
2023-10-31 15:31:57 -04:00
|
|
|
diff --git a/src/lib/libdwarf/cmake/libdwarf-config.cmake b/src/lib/libdwarf/cmake/libdwarf-config.cmake
|
2024-02-05 19:11:53 -06:00
|
|
|
index 604c563c..53623603 100644
|
2023-10-31 15:31:57 -04:00
|
|
|
--- a/src/lib/libdwarf/cmake/libdwarf-config.cmake
|
|
|
|
+++ b/src/lib/libdwarf/cmake/libdwarf-config.cmake
|
|
|
|
@@ -1,3 +1,6 @@
|
|
|
|
+include(CMakeFindDependencyMacro)
|
|
|
|
+find_dependency(ZLIB)
|
|
|
|
+find_dependency(zstd CONFIG)
|
|
|
|
if (NOT TARGET libdwarf::libdwarf)
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/libdwarf-targets.cmake)
|
|
|
|
endif()
|
|
|
|
diff --git a/src/lib/libdwarf/libdwarf.pc.cmake b/src/lib/libdwarf/libdwarf.pc.cmake
|
2024-02-05 19:11:53 -06:00
|
|
|
index 6b18c77c..8862d5b4 100644
|
2023-10-31 15:31:57 -04:00
|
|
|
--- a/src/lib/libdwarf/libdwarf.pc.cmake
|
|
|
|
+++ b/src/lib/libdwarf/libdwarf.pc.cmake
|
2024-02-05 19:11:53 -06:00
|
|
|
@@ -9,4 +9,4 @@ Description: DWARF debug symbols library
|
2023-10-31 15:31:57 -04:00
|
|
|
Version: @PACKAGE_VERSION@
|
|
|
|
Libs: -L${libdir} -ldwarf
|
|
|
|
Cflags: -I${includedir}
|
2024-02-05 19:11:53 -06:00
|
|
|
-
|
2023-10-31 15:31:57 -04:00
|
|
|
+Requires.private: zlib libzstd
|