From 02df643380e9feb6917265704081b54c2096a98c Mon Sep 17 00:00:00 2001 From: Rachel Date: Sat, 17 Feb 2024 09:56:49 -0800 Subject: [PATCH] Compute relative paths for directories in battle script build --- meson.build | 2 +- res/battle/scripts/meson.build | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 155f6aa296..0e60b99cc8 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('pokeplatinum', ['c', 'cpp', 'nasm'], version: '1.0', - meson_version: '>=1.2.0', + meson_version: '>=1.3.0', default_options : [ 'buildtype=plain', 'warning_level=0' diff --git a/res/battle/scripts/meson.build b/res/battle/scripts/meson.build index f1150cf9b6..14f26c51d2 100644 --- a/res/battle/scripts/meson.build +++ b/res/battle/scripts/meson.build @@ -2,13 +2,16 @@ subdir('effects') subdir('moves') subdir('subscripts') +relative_source_root = fs.relative_to(meson.project_source_root(), meson.project_build_root()) +relative_build_dir = fs.relative_to(meson.current_build_dir(), meson.project_build_root()) + s_to_bin_gen = generator(make_script_bin_sh, arguments: [ '--mwrap', - '-i', meson.project_source_root() / 'include', - '-i', meson.project_source_root() / 'asm', - '-i', meson.project_build_root() / 'res' / 'text', - '-i', meson.project_build_root(), + '-i', relative_source_root / 'include', + '-i', relative_source_root / 'asm', + '-i', '.' / 'res' / 'text', + '-i', '.', '--assembler', mwrap_exe.full_path(), '--objcopy', arm_none_eabi_objcopy_exe.full_path(), '@EXTRA_ARGS@', @@ -24,9 +27,9 @@ be_seq_target_name = 'be_seq.narc' sub_seq_target_name = 'sub_seq.narc' waza_seq_target_name = 'waza_seq.narc' -be_seq_private_dir = meson.current_build_dir() / be_seq_target_name + '.p' -sub_seq_private_dir = meson.current_build_dir() / sub_seq_target_name + '.p' -waza_seq_private_dir = meson.current_build_dir() / waza_seq_target_name + '.p' +be_seq_private_dir = relative_build_dir / be_seq_target_name + '.p' +sub_seq_private_dir = relative_build_dir / sub_seq_target_name + '.p' +waza_seq_private_dir = relative_build_dir / waza_seq_target_name + '.p' be_seq_narc = custom_target(be_seq_target_name, output: be_seq_target_name,