From 8a16f48f26c73c5baa8bdf0d76602301fe763d97 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 19 Dec 2024 04:48:32 +0000 Subject: [PATCH] Add self.build_dir --- tools/system_libs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/system_libs.py b/tools/system_libs.py index 73b9df9a44542..19bd7b4a6e099 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -472,6 +472,7 @@ def generate_ninja(self, build_dir, libname): ensure_sysroot() utils.safe_ensure_dirs(build_dir) self.batch_inputs = True + self.build_dir = build_dir cflags = self.get_cflags() asflags = get_base_cflags(preprocess=False) @@ -487,6 +488,7 @@ def build_objects(self, build_dir): with the `cflags` returned by `self.get_cflags()`. """ self.batch_inputs = int(os.environ.get('EMCC_BATCH_BUILD', '1')) + self.build_dir = build_dir batches = {} commands = [] objects = set() @@ -602,7 +604,7 @@ def get_cflags(self): if self.deterministic_paths: source_dir = utils.path_from_root() if self.batch_inputs: - relative_source_dir = os.path.relpath(source_dir, build_dir) + relative_source_dir = os.path.relpath(source_dir, self.build_dir) cflags += [f'-ffile-prefix-map={relative_source_dir}={DETERMINISITIC_PREFIX}'] cflags += [f'-ffile-prefix-map={source_dir}={DETERMINISITIC_PREFIX}', f'-fdebug-compilation-dir={DETERMINISITIC_PREFIX}']