diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 10:04:54 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 10:04:54 +0000 |
| commit | 066a378ca09ccc5d8074a942cf4bf1b9d4f40729 (patch) | |
| tree | 9a6ff973e6ef07f6fec425413868805d6aed4b03 /tools | |
| parent | 0305500e31eda6fe6da84f88748fc20843aebbce (diff) | |
fix(driver): default native output to .exe on Windows
Without -o, cpsc saved test.out on every OS, which Windows cannot run
directly. Use .exe under _WIN32 and keep .out elsewhere; update the
manual and architecture notes accordingly.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/driver/main.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/driver/main.cc b/tools/driver/main.cc index 0b3033f..2908a0a 100644 --- a/tools/driver/main.cc +++ b/tools/driver/main.cc @@ -200,7 +200,12 @@ int main(int argc, char **argv) { if (OutputPath.empty() && Save) { llvm::SmallString<256> DefaultPath(InputPaths[CG.getMainUnit()]); - llvm::sys::path::replace_extension(DefaultPath, EmitIR ? ".ll" : ".out"); +#ifdef _WIN32 + const char *ExecutableExtension = ".exe"; +#else + const char *ExecutableExtension = ".out"; +#endif + llvm::sys::path::replace_extension(DefaultPath, EmitIR ? ".ll" : ExecutableExtension); OutputPath = std::string(DefaultPath); } for (const auto &InputPath : InputPaths) { |
