diff --git a/configure.py b/configure.py index 5e85ff7..54b7e24 100755 --- a/configure.py +++ b/configure.py @@ -44,7 +44,7 @@ parser.add_argument( choices=VERSIONS, type=str.upper, default=VERSIONS[DEFAULT_VERSION], - help=f"version to build", + help="version to build", ) parser.add_argument( "--build-dir", @@ -70,6 +70,11 @@ parser.add_argument( action="store_true", help="generate map file(s)", ) +parser.add_argument( + "--no-asm", + action="store_true", + help="don't incorporate .s files from asm directory", +) parser.add_argument( "--debug", action="store_true", @@ -115,6 +120,8 @@ config.generate_map = args.map config.sjiswrap_path = args.sjiswrap if not is_windows(): config.wrapper = args.wrapper +if args.no_asm: + config.asm_dir = None # Tool versions config.binutils_tag = "2.42-1" diff --git a/tools/project.py b/tools/project.py index 1160911..0f756cf 100644 --- a/tools/project.py +++ b/tools/project.py @@ -54,7 +54,9 @@ class ProjectConfig: self.build_dir: Path = Path("build") # Output build files self.src_dir: Path = Path("src") # C/C++/asm source files self.tools_dir: Path = Path("tools") # Python scripts - self.asm_dir: Path = Path("asm") # Override incomplete objects (for modding) + self.asm_dir: Optional[Path] = Path( + "asm" + ) # Override incomplete objects (for modding) # Tooling self.binutils_tag: Optional[str] = None # Git tag @@ -676,6 +678,8 @@ def generate_build_ninja( options[key] = value unit_src_path = Path(lib.get("src_dir", config.src_dir)) / options["source"] + + unit_asm_path: Optional[Path] = None if config.asm_dir is not None: unit_asm_path = ( Path(lib.get("asm_dir", config.asm_dir)) / options["source"] @@ -697,6 +701,7 @@ def generate_build_ninja( link_built_obj = False # Assembly overrides + built_obj_path: Optional[Path] = None if unit_asm_path is not None and unit_asm_path.exists(): link_built_obj = True built_obj_path = asm_build(obj, options, lib_name, unit_asm_path)