Skip to content

Commit 8d76b57

Browse files
committed
fix: Windows binary output needs .exe suffix + clean ldflags
LinkUnit output was "bin/mcpp" without .exe on Windows. Clang+MSVC linker may or may not add .exe automatically, but the find command needs it. Explicitly add .exe suffix for Binary and TestBinary targets.
1 parent 612a84c commit 8d76b57

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/build/plan.cppm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,19 @@ BuildPlan make_plan(const mcpp::manifest::Manifest& manifest,
178178
lu.output = std::filesystem::path("bin") / std::format("lib{}.so", t.name);
179179
} else if (t.kind == mcpp::manifest::Target::TestBinary) {
180180
lu.kind = LinkUnit::TestBinary;
181+
#if defined(_WIN32)
182+
lu.output = std::filesystem::path("bin") / (t.name + ".exe");
183+
#else
181184
lu.output = std::filesystem::path("bin") / t.name;
185+
#endif
182186
if (!t.main.empty()) lu.entryMain = projectRoot / t.main;
183187
} else {
184188
lu.kind = LinkUnit::Binary;
189+
#if defined(_WIN32)
190+
lu.output = std::filesystem::path("bin") / (t.name + ".exe");
191+
#else
185192
lu.output = std::filesystem::path("bin") / t.name;
193+
#endif
186194
if (!t.main.empty()) lu.entryMain = projectRoot / t.main;
187195
}
188196

0 commit comments

Comments
 (0)