summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch')
-rw-r--r--meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch b/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch
new file mode 100644
index 0000000000..adc0d67d97
--- /dev/null
+++ b/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-specifying-path-to-7z-library-in-tests.patch
@@ -0,0 +1,48 @@
1From 60137ec132951f941f2fb98cd6353717b322cbf1 Mon Sep 17 00:00:00 2001
2From: Peter Marko <peter.marko@siemens.com>
3Date: Wed, 2 Apr 2025 10:17:38 +0200
4Subject: [PATCH] Allow specifying path to 7z library in tests
5
6For instance to override path to library on Linux when using real 7-zip
7instead of pzip: /usr/lib/lib7z.so
8
9Upstream-Status: Submitted [https://github.com/rikyoz/bit7z/pull/288]
10Signed-off-by: Peter Marko <peter.marko@siemens.com>
11---
12 tests/CMakeLists.txt | 7 +++++++
13 tests/src/utils/shared_lib.hpp | 4 +++-
14 2 files changed, 10 insertions(+), 1 deletion(-)
15
16diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
17index 60da280d..1307366a 100644
18--- a/tests/CMakeLists.txt
19+++ b/tests/CMakeLists.txt
20@@ -103,6 +103,13 @@ message( STATUS "Use system 7-zip for tests: ${BIT7Z_TESTS_USE_SYSTEM_7ZIP}" )
21 if( BIT7Z_TESTS_USE_SYSTEM_7ZIP )
22 target_compile_definitions( ${TESTS_TARGET} PRIVATE BIT7Z_TESTS_USE_SYSTEM_7ZIP )
23 target_compile_definitions( ${TESTS_TARGET_PUBLIC} PRIVATE BIT7Z_TESTS_USE_SYSTEM_7ZIP )
24+else()
25+ set( BIT7Z_TESTS_7Z_LIBRARY_PATH "" CACHE STRING "The path of the 7-Zip library to be used for running the tests" )
26+ if( NOT BIT7Z_TESTS_7Z_LIBRARY_PATH STREQUAL "" )
27+ message( STATUS "Use custom 7-zip library for tests: ${BIT7Z_TESTS_7Z_LIBRARY_PATH}" )
28+ target_compile_definitions( ${TESTS_TARGET} PRIVATE BIT7Z_TESTS_7Z_LIBRARY_PATH="${BIT7Z_TESTS_7Z_LIBRARY_PATH}" )
29+ target_compile_definitions( ${TESTS_TARGET_PUBLIC} PRIVATE BIT7Z_TESTS_7Z_LIBRARY_PATH="${BIT7Z_TESTS_7Z_LIBRARY_PATH}" )
30+ endif()
31 endif()
32
33 # Avoiding linking unnecessary libraries.
34diff --git a/tests/src/utils/shared_lib.hpp b/tests/src/utils/shared_lib.hpp
35index 41435a9b..8bc02939 100644
36--- a/tests/src/utils/shared_lib.hpp
37+++ b/tests/src/utils/shared_lib.hpp
38@@ -20,7 +20,9 @@ namespace bit7z {
39 namespace test {
40
41 inline auto sevenzip_lib_path() -> tstring {
42-#ifdef BIT7Z_TESTS_USE_SYSTEM_7ZIP
43+#ifdef BIT7Z_TESTS_7Z_LIBRARY_PATH
44+ static const tstring lib_path = BIT7Z_STRING( BIT7Z_TESTS_7Z_LIBRARY_PATH );
45+#elif defined( BIT7Z_TESTS_USE_SYSTEM_7ZIP )
46 #ifdef _WIN64
47 static const tstring lib_path = BIT7Z_STRING( "C:\\Program Files\\7-Zip\\7z.dll" );
48 #elif defined( _WIN32 )