Skip to content

Instantly share code, notes, and snippets.

@petetnt
Created January 13, 2026 22:03
Show Gist options
  • Select an option

  • Save petetnt/4de80f598093b54638cbb7c35952c42a to your computer and use it in GitHub Desktop.

Select an option

Save petetnt/4de80f598093b54638cbb7c35952c42a to your computer and use it in GitHub Desktop.
tcc build
diff --git a/ninja_config.py b/ninja_config.py
index 7317fa1b..71e36d15 100644
--- a/ninja_config.py
+++ b/ninja_config.py
@@ -189,7 +189,7 @@ elif sys.platform == "win32":
LD = f"{CROSS}-ld.exe"
OBJCOPY = f"{CROSS}-objcopy.exe"
OBJDUMP = f"{CROSS}-objdump.exe"
- CPP = f"{TOOLS_DIR}/win-build/mcpp/mcpp.exe"
+ CPP = f"{TOOLS_DIR}/win-build/tcc/tcc.exe"
CC = f"{TOOLS_DIR}/win-build/gcc-psx/cc1psx.exe"
CC272 = f"{TOOLS_DIR}/win-build/gcc-2.7.2-win/cc1psx.exe"
OBJDIFF = f"{OBJDIFF_DIR}\\objdiff.exe"
@@ -213,7 +213,7 @@ if sys.platform == "linux" or sys.platform == "linux2":
MASPSX_FLAGS = f"--aspsx-version=2.77 --run-assembler"
ICONV_FLAGS = f"-f UTF-8 -t SHIFT-JIS $in -o $out"
elif sys.platform == "win32":
- CPP_FLAGS = f"{INCLUDE_FLAGS} -D_LANGUAGE_C -DUSE_INCLUDE_ASM -P -MMD -MP -N -Wall -I-"
+ CPP_FLAGS = f"{INCLUDE_FLAGS} -D_LANGUAGE_C -DUSE_INCLUDE_ASM -P -MD -Wall -I-"
MASPSX_FLAGS = f"--gnu-as-path {AS} --run-assembler"
ICONV_FLAGS = f"$in $out"
CC_FLAGS = f"{OPT_FLAGS} -mips1 -mcpu=3000 -w -funsigned-char -fpeephole -ffunction-cse -fpcc-struct-return -fcommon -fverbose-asm -msoft-float -mgas -fgnu-linker -quiet"
@@ -404,7 +404,7 @@ def ninja_build(split_entries, game_version_idx: int, objdiff_mode: bool, skip_c
ninjaRulesFile.rule(
"cpp", description="cpp $in",
- command=f"{CPP} -P -MMD -MP -MT $out -MF $out.d {CPP_FLAGS} $VERSION $MAPIDFLAG $SKIPASMFLAG $NONMATCHINGFLAG -o $out $in",
+ command=f"{CPP} -P -MD -E $out -MF $out.d {CPP_FLAGS} $VERSION $MAPIDFLAG $SKIPASMFLAG $NONMATCHINGFLAG -o $out $in",
depfile="$out.d"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment