Skip to content

Commit e0b8410

Browse files
committed
Use common build directory for ports and system libs. NFC
Split out from emscripten-core#23924
1 parent 340aa0f commit e0b8410

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tools/ports/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def erase():
233233

234234
@staticmethod
235235
def get_build_dir():
236-
return cache.get_path('ports-builds')
236+
return system_libs.get_build_dir()
237237

238238
name_cache: Set[str] = set()
239239

tools/system_libs.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def get_base_cflags(build_dir, force_object_files=False, preprocess=True):
7979
return flags
8080

8181

82+
def get_build_dir():
83+
return cache.get_path('build')
84+
85+
8286
def clean_env():
8387
# building system libraries and ports should be hermetic in that it is not
8488
# affected by things like EMCC_CFLAGS which the user may have set.
@@ -150,7 +154,7 @@ def create_lib(libname, inputs):
150154

151155

152156
def get_top_level_ninja_file():
153-
return os.path.join(cache.get_path('build'), 'build.ninja')
157+
return os.path.join(get_build_dir(), 'build.ninja')
154158

155159

156160
def run_ninja(build_dir):
@@ -552,7 +556,7 @@ def customize_build_cmd(self, cmd, _filename):
552556
def do_build(self, out_filename, generate_only=False):
553557
"""Builds the library and returns the path to the file."""
554558
assert out_filename == self.get_path(absolute=True)
555-
build_dir = os.path.join(cache.get_path('build'), self.get_base_name())
559+
build_dir = os.path.join(get_build_dir(), self.get_base_name())
556560
if USE_NINJA:
557561
self.generate_ninja(build_dir, out_filename)
558562
if not generate_only:

0 commit comments

Comments
 (0)