This is a C++ program for Windows, using mostly win32 windows API functions
We don't use STL but our own string / helper / container functions implemented in src\utils directory
Assume that Visual Studio command-line tools are available in the PATH environment variable (cl.exe, msbuild.exe etc.)
Our code is in src/ directory. External dependencies are in ext/ directory and mupdf\ directory
To build run: bun ./cmd/build.ts
This creates ./out/dbg64/SumatraPDF.exe executable
To debug run: windbgx -Q -o -g ./out/dbg64/SumatraPDF.exe
After making a change to .cpp, .c or .h file (and before running build.ts), run clang-format on those files to reformat them in place
When commiting changes also commit ailog.txt (if changed)
The Bash tool runs under Git Bash (MSYS2), not cmd.exe. This causes critical issues with Windows-style commands:
- NEVER use
2>nul— Bash interprets this literally and creates a file callednul. On Windows NTFS,nulis a reserved device name, making the file extremely difficult to delete (requires UAC/admin privileges). Use2>/dev/nullinstead. - NEVER use
rmdir /s /q— Bashrmdirdoes not understand cmd.exe flags. Userm -rfinstead. - NEVER use
del— Not available in Bash. Userminstead. - NEVER use
dir— Uselsinstead. - For Windows-native commands, wrap in
cmd /c "..."explicitly. - In general, always use Unix-style commands and paths in the Bash tool.