From 2f94ccb0628961aaebbe88a7cfe5323fd92489f5 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 17 Sep 2024 19:21:54 -0600 Subject: [PATCH] Minor cleanup --- configure.py | 10 +++++++++- tools/project.py | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index 5ecb9ac..6f478dd 100755 --- a/configure.py +++ b/configure.py @@ -16,7 +16,15 @@ import argparse import sys from pathlib import Path from typing import Any, Dict, List -from tools.project import * + +from tools.project import ( + Object, + ProgressCategory, + ProjectConfig, + calculate_progress, + generate_build, + is_windows, +) # Game versions DEFAULT_VERSION = 0 diff --git a/tools/project.py b/tools/project.py index c45f93e..d085c3b 100644 --- a/tools/project.py +++ b/tools/project.py @@ -213,11 +213,13 @@ CHAIN = "cmd /c " if is_windows() else "" EXE = ".exe" if is_windows() else "" -def make_flags_str(cflags: Union[str, List[str]]) -> str: - if isinstance(cflags, list): - return " ".join(cflags) +def make_flags_str(flags: Optional[Union[str, List[str]]]) -> str: + if flags is None: + return "" + elif isinstance(flags, list): + return " ".join(flags) else: - return cflags + return flags # Load decomp-toolkit generated config.json @@ -282,7 +284,7 @@ def generate_build_ninja( # Variables ### n.comment("Variables") - n.variable("ldflags", " ".join(config.ldflags or [])) + n.variable("ldflags", make_flags_str(config.ldflags)) if config.linker_version is None: sys.exit("ProjectConfig.linker_version missing") n.variable("mw_version", Path(config.linker_version))