Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
encounter committed Sep 18, 2024
1 parent f49a9cb commit 2f94ccb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 9 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
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
Expand Down
12 changes: 7 additions & 5 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ def is_windows() -> bool:
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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 2f94ccb

Please sign in to comment.