diff options
Diffstat (limited to 'meta-oe/recipes-extended/7zip/bit7z/0001-Allow-running-tests-on-target-when-cross-compiling.patch')
-rw-r--r-- | meta-oe/recipes-extended/7zip/bit7z/0001-Allow-running-tests-on-target-when-cross-compiling.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-running-tests-on-target-when-cross-compiling.patch b/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-running-tests-on-target-when-cross-compiling.patch new file mode 100644 index 0000000000..b6e24a9519 --- /dev/null +++ b/meta-oe/recipes-extended/7zip/bit7z/0001-Allow-running-tests-on-target-when-cross-compiling.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 9f0eed91d32ec2f310bd5c23af187f888394fcb4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Marko <peter.marko@siemens.com> | ||
3 | Date: Wed, 2 Apr 2025 09:33:03 +0200 | ||
4 | Subject: [PATCH] Allow running tests on target when cross-compiling | ||
5 | |||
6 | When bit7z is Cross-compiled, target device does not contain | ||
7 | source/build directory anymore and thus path to test data is different. | ||
8 | Make it possible to pass the new path to cmake. | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/rikyoz/bit7z/pull/289] | ||
11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
12 | --- | ||
13 | tests/CMakeLists.txt | 9 +++++++-- | ||
14 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt | ||
17 | index 60da280..dbdff1f 100644 | ||
18 | --- a/tests/CMakeLists.txt | ||
19 | +++ b/tests/CMakeLists.txt | ||
20 | @@ -49,6 +49,11 @@ add_executable( ${TESTS_TARGET_PUBLIC} ${SOURCE_FILES} ${PUBLIC_API_SOURCE_FILES | ||
21 | |||
22 | if( BIT7Z_TESTS_FILESYSTEM ) | ||
23 | set( BIT7Z_TESTS_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/data ) | ||
24 | + if( NOT BIT7Z_TESTS_DATA_DIR_TARGET ) | ||
25 | + set( BIT7Z_TESTS_DATA_DIR_TARGET ${BIT7Z_TESTS_DATA_DIR} ) | ||
26 | + else() | ||
27 | + message( STATUS "Custom test data dir on target: ${BIT7Z_TESTS_DATA_DIR_TARGET}" ) | ||
28 | + endif() | ||
29 | |||
30 | include( FetchContent ) | ||
31 | FetchContent_Declare( bit7z-test-data | ||
32 | @@ -61,11 +66,11 @@ if( BIT7Z_TESTS_FILESYSTEM ) | ||
33 | message( STATUS "Tests data directory: ${BIT7Z_TESTS_DATA_DIR}" ) | ||
34 | target_compile_definitions( ${TESTS_TARGET} PRIVATE | ||
35 | BIT7Z_TESTS_FILESYSTEM | ||
36 | - BIT7Z_TESTS_DATA_DIR="${BIT7Z_TESTS_DATA_DIR}" ) | ||
37 | + BIT7Z_TESTS_DATA_DIR="${BIT7Z_TESTS_DATA_DIR_TARGET}" ) | ||
38 | target_compile_definitions( ${TESTS_TARGET_PUBLIC} PRIVATE | ||
39 | BIT7Z_TESTS_PUBLIC_API_ONLY | ||
40 | BIT7Z_TESTS_FILESYSTEM | ||
41 | - BIT7Z_TESTS_DATA_DIR="${BIT7Z_TESTS_DATA_DIR}" ) | ||
42 | + BIT7Z_TESTS_DATA_DIR="${BIT7Z_TESTS_DATA_DIR_TARGET}" ) | ||
43 | if( NOT EXISTS ${BIT7Z_TESTS_DATA_DIR}/test_filesystem/empty ) | ||
44 | file( MAKE_DIRECTORY ${BIT7Z_TESTS_DATA_DIR}/test_filesystem/empty ) | ||
45 | endif() | ||