updated configs stuff and prints

This commit is contained in:
OusmBlueNinja 2025-04-16 17:04:33 -05:00
parent f3520f0012
commit 276f23b8de
3 changed files with 14 additions and 9 deletions

View File

@ -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

View File

@ -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")

View File

@ -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