run_target(
'update-hwdb-autosuspend',
- command : [update_hwdb_autosuspend_sh, project_source_root])
+ command : [update_hwdb_autosuspend_sh, meson.project_source_root()])
############################################################
buildroot_substs = configuration_data()
-buildroot_substs.set_quoted('BUILD_ROOT', project_build_root)
+buildroot_substs.set_quoted('BUILD_ROOT', meson.project_build_root())
configure_file(
input : 'man.in',
update_dbus_docs = custom_target(
'update-dbus-docs-impl',
output : 'update-dbus-docs',
- command : [update_dbus_docs_py, '--build-dir', project_build_root, '@INPUT@'],
+ command : [update_dbus_docs_py, '--build-dir', meson.project_build_root(), '@INPUT@'],
input : dbus_docs,
depends : dbus_programs)
test('dbus-docs-fresh',
update_dbus_docs_py,
suite : 'dist',
- args : ['--build-dir', project_build_root, '--test', dbus_docs],
+ args : ['--build-dir', meson.project_build_root(), '--test', dbus_docs],
depends : dbus_programs)
test('check-version-history',
'update-man-rules-impl',
output : 'update-man-rules',
command : [update_man_rules_py,
- '@0@/man/*.xml'.format(project_source_root),
+ '@0@/man/*.xml'.format(meson.project_source_root()),
'@0@/rules/meson.build'.format(meson.current_source_dir())],
depends : man_page_depends)
description : 'Numerical project version (used where a simple number is expected)')
conf.set_quoted('PROJECT_VERSION_FULL', meson.project_version(), description : 'Full project version')
-# This is to be used instead of meson.source_root(), as the latter will return
-# the wrong result when systemd is being built as a meson subproject
-project_source_root = meson.current_source_dir()
-project_build_root = meson.current_build_dir()
relative_source_path = run_command('realpath',
- '--relative-to=@0@'.format(project_build_root),
- project_source_root,
+ '--relative-to=@0@'.format(meson.project_build_root()),
+ meson.project_source_root(),
check : true).stdout().strip()
conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
output : 'systemd-runtest.env',
command : [sh, '-c',
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
- project_source_root / 'test',
- project_build_root / 'catalog')],
+ meson.project_source_root() / 'test',
+ meson.project_build_root() / 'catalog')],
depends : catalogs,
build_by_default : true)
jekyll,
suite : 'dist',
args : ['build',
- '--source', project_source_root / 'docs',
- '--destination', project_build_root / '_site'])
+ '--source', meson.project_source_root() / 'docs',
+ '--destination', meson.project_build_root() / '_site'])
endif
#####################################################################
if git.found()
all_files = run_command(
env, '-u', 'GIT_WORK_TREE',
- git, '--git-dir=@0@/.git'.format(project_source_root),
+ git, '--git-dir=@0@/.git'.format(meson.project_source_root()),
'ls-files', ':/*.[ch]', ':/*.cc',
check : false)
if all_files.returncode() == 0
custom_target(
'tags',
output : 'tags',
- command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
+ command : [env, 'etags', '-o', '@0@/TAGS'.format(meson.project_source_root())] + all_files)
run_target(
'ctags',
- command : [env, 'ctags', '--tag-relative=never', '-o', '@0@/tags'.format(project_source_root)] + all_files)
+ command : [env, 'ctags', '--tag-relative=never', '-o', '@0@/tags'.format(meson.project_source_root())] + all_files)
############################################
test('check-includes',
files('tools/check-includes.py'),
args: all_files,
- env : ['PROJECT_SOURCE_ROOT=@0@'.format(project_source_root)],
+ env : ['PROJECT_SOURCE_ROOT=@0@'.format(meson.project_source_root())],
suite : 'headers')
endif
endif
####################################################
git_head = run_command(
- git, '--git-dir=@0@/.git'.format(project_source_root),
+ git, '--git-dir=@0@/.git'.format(meson.project_source_root()),
'rev-parse', 'HEAD',
check : false).stdout().strip()
git_head_short = run_command(
- git, '--git-dir=@0@/.git'.format(project_source_root),
+ git, '--git-dir=@0@/.git'.format(meson.project_source_root()),
'rev-parse', '--short=7', 'HEAD',
check : false).stdout().strip()
run_target(
'git-snapshot',
command : [git, 'archive',
- '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root,
+ '-o', '@0@/systemd-@1@.tar.gz'.format(meson.project_source_root(),
git_head_short),
'--prefix', 'systemd-@0@/'.format(git_head),
'HEAD'])
capture : true,
install : want_tests != 'no' and install_tests,
install_dir : testdata_dir,
- command : [meson_extract_unit_files, project_build_root])
+ command : [meson_extract_unit_files, meson.project_build_root()])
#####################################################################
path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip()
test_env = environment()
test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
-test_env.set('PATH', project_build_root + ':' + path)
-test_env.set('PROJECT_BUILD_ROOT', project_build_root)
+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')
if efi_addon != ''
'luks.options=0d318174-56b0-4d6e-a324-ac1e7e7d235d=x-initrd.attach',
],
'qemu-args' : [
- '-drive', 'id=keydev,if=none,format=raw,cache=unsafe,file=@0@'.format(project_build_root / 'mkosi.output/keydev.raw'),
+ '-drive', 'id=keydev,if=none,format=raw,cache=unsafe,file=@0@'.format(meson.project_build_root() / 'mkosi.output/keydev.raw'),
'-device', 'scsi-hd,drive=keydev,serial=keydev',
],
'mkosi-args' : integration_test_template['mkosi-args'] + [
'sanitize-address-undefined-fuzzers',
output : 'sanitize-address-undefined-fuzzers',
command : [meson_build_sh,
- project_source_root,
+ meson.project_source_root(),
'@OUTPUT@',
'fuzzers',
' '.join(fuzz_c_args + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
fuzz_sanitizers = [['address,undefined', sanitize_address_undefined]]
fuzz_testsdir = 'test/fuzz'
-if git.found() and fs.is_dir(project_source_root / '.git')
+if git.found() and fs.is_dir(meson.project_source_root() / '.git')
out = run_command(env, '-u', 'GIT_WORK_TREE',
- git, '--git-dir=@0@/.git'.format(project_source_root),
+ git, '--git-dir=@0@/.git'.format(meson.project_source_root()),
'ls-files', ':/@0@/*/*'.format(fuzz_testsdir),
check: true)
else
- out = run_command(sh, '-c', 'cd "@0@"; echo @1@/*/*'.format(project_source_root, fuzz_testsdir), check: true)
+ out = run_command(sh, '-c', 'cd "@0@"; echo @1@/*/*'.format(meson.project_source_root(), fuzz_testsdir), check: true)
endif
# Add crafted fuzz inputs we have in the repo
test('test-rpm-macros',
test_rpm_macros,
suite : 'dist',
- args : [project_build_root])
+ args : [meson.project_build_root()])
endif
else
message('Skipping test-rpm-macros since rpm and/or rpmspec are not available')
udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
exe = executables_by_name.get('dmi_memory_id')
- if git.found() and fs.is_dir(project_source_root / '.git')
+ if git.found() and fs.is_dir(meson.project_source_root() / '.git')
out = run_command(
env, '-u', 'GIT_WORK_TREE',
- git, '--git-dir=@0@/.git'.format(project_source_root),
+ git, '--git-dir=@0@/.git'.format(meson.project_source_root()),
'ls-files', ':/test/dmidecode-dumps/*.bin',
check: true)
else
out = run_command(
- sh, '-c', 'cd "$1"; echo test/dmidecode-dumps/*.bin', '_', project_source_root,
+ sh, '-c', 'cd "$1"; echo test/dmidecode-dumps/*.bin', '_', meson.project_source_root(),
check: true)
endif
foreach p : out.stdout().split()
- source = project_source_root / p
+ source = meson.project_source_root() / p
test('dmidecode_' + fs.stem(p),
udev_dmi_memory_id_test,
suite : 'udev',