Skip to content

Commit 03c1930

Browse files
committed
Use a separate build directory for each port
This allows building them simultaneously with Ninja. Split out from emscripten-core#23924
1 parent c09f5a0 commit 03c1930

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/ports/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import hashlib
88
import os
9+
from pathlib import Path
910
import shutil
1011
import glob
1112
import importlib.util
@@ -176,7 +177,9 @@ def install_headers(src_dir, pattern='*.h', target=None):
176177

177178
@staticmethod
178179
def build_port(src_dir, output_path, port_name, includes=[], flags=[], cxxflags=[], exclude_files=[], exclude_dirs=[], srcs=[]): # noqa
179-
build_dir = os.path.join(Ports.get_build_dir(), port_name)
180+
mangled_name = str(Path(output_path).relative_to(cache.get_sysroot(True))).replace(os.sep, '_').replace('.', '_')
181+
build_dir = os.path.join(Ports.get_build_dir(), mangled_name)
182+
logger.debug(f'build_port: {port_name} {output_path} in {build_dir}')
180183
if srcs:
181184
srcs = [os.path.join(src_dir, s) for s in srcs]
182185
else:

0 commit comments

Comments
 (0)