]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: do not reference variable unless feature that defines it is enabled
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 5 Jul 2025 19:21:00 +0000 (20:21 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 5 Jul 2025 19:21:00 +0000 (20:21 +0100)
SYSTEMD_LANGUAGE_FALLBACK_MAP is used by the localed test, and
language_fallback_map is defined by the localed meson.
If the feature is disabled, the test is not built so the env var
is not needed, and the meson variable is not defined so the build
fails.

src/test/meson.build

index 286fcac5c7eaf79ba82dc9113f1757b76b83acd2..e99605af7232614668e4a6032f997bb24de155fa 100644 (file)
@@ -12,7 +12,9 @@ generated_sources += test_hashmap_ordered_c
 
 path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip()
 test_env = environment()
-test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
+if conf.get('ENABLE_LOCALED') == 1
+        test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
+endif
 test_env.set('PATH', meson.project_build_root() + ':' + path)
 test_env.set('PROJECT_BUILD_ROOT', meson.project_build_root())
 test_env.set('SYSTEMD_SLOW_TESTS', want_slow_tests ? '1' : '0')