From be26ca4d84e9af7e46511977c1ca92d7644ed722 Mon Sep 17 00:00:00 2001 From: Lightmann Date: Fri, 12 Jan 2024 13:35:10 -0500 Subject: [PATCH] Fix iOS plat check and add default toolchain config --- src/dragongen/generation.py | 14 +++++++++++--- src/dragongen/toolchain.py | 18 +++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/dragongen/generation.py b/src/dragongen/generation.py index 77c843bc6..5748d5c73 100644 --- a/src/dragongen/generation.py +++ b/src/dragongen/generation.py @@ -193,11 +193,18 @@ def generate_vars(self, module_variables: dict, target: str) -> dict: # Specify toolchain paths use_objcs = 'objcs' in project_dict - if platform.platform().startswith('macOS'): - toolchain = Toolchain.locate_macos_toolchain(use_objcs) + sys = platform.system() + if sys == 'Darwin': + plat = platform.platform() + if 'iP' in plat: + toolchain = Toolchain() + else: + toolchain = Toolchain.locate_macos_toolchain(use_objcs) # elif WINDOWS IS NOT A REAL OPERATING SYSTEM ::::) - else: + elif sys == 'Linux': toolchain = Toolchain.locate_linux_toolchain(use_objcs) + else: + toolchain = Toolchain() if toolchain is None: dberror("Dragon Gen", "Could not locate any usable toolchain or even determine the existence of clang.") @@ -552,6 +559,7 @@ def handle(ex: Exception): else: dberror("Dragon Gen", "Exiting...") except Exception: + dberror("Dragon Gen", f'tty/termios unavailable: {ex}') dberror("Dragon Gen", "Exiting...") print('export DRAGONGEN_FAILURE=1') diff --git a/src/dragongen/toolchain.py b/src/dragongen/toolchain.py index a15f4eb1a..fbe1df63e 100644 --- a/src/dragongen/toolchain.py +++ b/src/dragongen/toolchain.py @@ -3,14 +3,15 @@ class Toolchain: def __init__(self): - self.ass = "" - self.clang = "" - self.clangpp = "" - self.ld = "" - self.codesign = "" - self.dsym = "" - self.lipo = "" - self.tapi = "" + self.clang = "clang" + self.clangpp = "clang++" + self.ass = self.clang + self.ld = self.clang + self.codesign = "ldid" + self.dsym = "dsymutil" + self.plutil = "plutil" + self.lipo = "lipo" + self.tapi = "tapi" @classmethod def locate_macos_toolchain(cls, use_objcs: bool): @@ -35,7 +36,6 @@ def locate_macos_toolchain(cls, use_objcs: bool): tc.clangpp = tc_dir + 'clang++' tc.ass = tc.clang tc.ld = tc.clang - tc.codesign = 'ldid' tc.dsym = tc_dir + 'dsymutil' # FIXME: hardcoded while I wait on a real distribution of llvm-objcs if use_objcs: