Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame^] | 1 | libdnf: allow reproducible binary builds |
| 2 | |
| 3 | Use a dummy directory for test data if not built WITH_TESTS. Allow for overriding |
| 4 | TESTDATADIR, since the default is guaranteed to be wrong for target builds. |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Joe Slater <joe.slater@windriver.com> |
| 9 | |
| 10 | |
| 11 | --- a/CMakeLists.txt |
| 12 | +++ b/CMakeLists.txt |
| 13 | @@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf |
| 14 | add_definitions(-D_FILE_OFFSET_BITS=64) |
| 15 | |
| 16 | # tests |
| 17 | -add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\") |
| 18 | +if(NOT WITH_TESTS) |
| 19 | + set(TEST_DATA_DIR "/notests") |
| 20 | +elseif(NOT DEFINED TEST_DATA_DIR) |
| 21 | + set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests") |
| 22 | +endif() |
| 23 | +add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\") |
| 24 | |
| 25 | # librhsm |
| 26 | if(ENABLE_RHSM_SUPPORT) |