Skip to content

Commit

Permalink
Add self.build_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
aheejin committed Dec 19, 2024
1 parent d936b1e commit 8a16f48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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}']
Expand Down

0 comments on commit 8a16f48

Please sign in to comment.