diff --git a/tools/ports/__init__.py b/tools/ports/__init__.py index 1088e9f817d92..69f1a7dfa839d 100644 --- a/tools/ports/__init__.py +++ b/tools/ports/__init__.py @@ -6,6 +6,7 @@ import logging import hashlib import os +from pathlib import Path import shutil import glob import importlib.util @@ -176,7 +177,10 @@ def install_headers(src_dir, pattern='*.h', target=None): @staticmethod def build_port(src_dir, output_path, port_name, includes=[], flags=[], cxxflags=[], exclude_files=[], exclude_dirs=[], srcs=[]): # noqa - build_dir = os.path.join(Ports.get_build_dir(), port_name) + mangled_name = str(Path(output_path).relative_to(Path(cache.get_sysroot(True)) / 'lib')) + mangled_name = mangled_name.replace(os.sep, '_').replace('.a', '').replace('-emscripten', '') + build_dir = os.path.join(Ports.get_build_dir(), port_name, mangled_name) + logger.debug(f'build_port: {port_name} {output_path} in {build_dir}') if srcs: srcs = [os.path.join(src_dir, s) for s in srcs] else: @@ -356,6 +360,7 @@ def clear_project_build(name): port = ports_by_name[name] port.clear(Ports, settings, shared) build_dir = os.path.join(Ports.get_build_dir(), name) + logger.debug(f'clearing port build: {name} {build_dir}') utils.delete_dir(build_dir) return build_dir diff --git a/tools/ports/sdl2_mixer.py b/tools/ports/sdl2_mixer.py index b08cbfb77d2cb..078ca497f751f 100644 --- a/tools/ports/sdl2_mixer.py +++ b/tools/ports/sdl2_mixer.py @@ -73,7 +73,6 @@ def create(final): if settings.PTHREADS: flags.append('-pthread') - build_dir = ports.clear_project_build('sdl2_mixer') include_path = os.path.join(source_path, 'include') includes = [ include_path, @@ -83,7 +82,7 @@ def create(final): ports.build_port( source_path, final, - build_dir, + 'sdl2_mixer', flags=flags, exclude_files=[ 'playmus.c',