From 276f23b8dee2d98aacb414e66bb672d3b0d55ea9 Mon Sep 17 00:00:00 2001 From: OusmBlueNinja <89956790+OusmBlueNinja@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:04:33 -0500 Subject: [PATCH] updated configs stuff and prints --- remake.yaml | 6 +++--- remake/remake.py | 9 +++++++-- remake/remake_config.py | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/remake.yaml b/remake.yaml index 6af9137..f5ee9a5 100644 --- a/remake.yaml +++ b/remake.yaml @@ -1,17 +1,17 @@ # Remake Build Configuration -# Source folders to recursively find .c/.cpp files +# Source folders src_dirs: - src - lua -# Include directories (-I) +# Include directories include_dirs: - include - lua - C:/msys64/mingw64/include -# Library search paths (-L) +# Library search paths lib_dirs: - C:/msys64/mingw64/lib - C:/libs diff --git a/remake/remake.py b/remake/remake.py index 6ff8107..5bd1d36 100644 --- a/remake/remake.py +++ b/remake/remake.py @@ -148,10 +148,11 @@ def compile_source(source, obj, includes): cmd = [compiler, *flags, *[f"-I{inc}" for inc in includes], "-MMD", "-MP", "-c", str(source), "-o", str(obj)] try: - print(f"{color('🔨 Compiling:', Colors.OKCYAN)} {source}") + print(f"\r{color('🔨 Compiling:', Colors.OKCYAN)} {source}{' ' * 40}", end="", flush=True) subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) log(f"[COMPILE] {' '.join(cmd)}") except subprocess.CalledProcessError as e: + print() # move to new line before showing error error(f"Failed to compile {source}") print("🔧 Command:", " ".join(cmd)) print(e.stderr.decode()) @@ -159,6 +160,8 @@ def compile_source(source, obj, includes): sys.exit(1) + + def link_objects(obj_files, link_dirs, libs): cmd = [CXX, *map(str, obj_files), "-o", str(TARGET), *[f"-L{p}" for p in link_dirs], *libs] try: @@ -200,8 +203,10 @@ def build(): if needs_build: compile_source(source, obj, all_includes) else: - print(f"{color('👌 Up-to-date:', Colors.GRAY)} {source}") + print(f"\r{color('👌 Up-to-date:', Colors.GRAY)} {source}{' ' * 20}", end="", flush=True) + obj_files.append(obj) + print() link_objects(obj_files, link_dirs, libs) banner("✅ Build Complete") diff --git a/remake/remake_config.py b/remake/remake_config.py index aae2d87..e834780 100644 --- a/remake/remake_config.py +++ b/remake/remake_config.py @@ -26,18 +26,18 @@ def info(msg): config_path = Path("remake.yaml") default_config = """\ -# 🔧 Remake Build Configuration +# Remake Build Configuration -# Source folders to recursively find .c/.cpp files +# Source folder src_dirs: - src -# Include directories (-I) +# Include directories include_dirs: - include - C:/msys64/mingw64/include -# Library search paths (-L) +# Library paths lib_dirs: - C:/msys64/mingw64/lib - C:/libs