File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,10 +172,18 @@ BuildPlan make_plan(const mcpp::manifest::Manifest& manifest,
172172 lu.targetName = t.name ;
173173 if (t.kind == mcpp::manifest::Target::Library) {
174174 lu.kind = LinkUnit::StaticLibrary;
175+ #if defined(_WIN32)
176+ lu.output = std::filesystem::path (" bin" ) / std::format (" {}.lib" , t.name );
177+ #else
175178 lu.output = std::filesystem::path (" bin" ) / std::format (" lib{}.a" , t.name );
179+ #endif
176180 } else if (t.kind == mcpp::manifest::Target::SharedLibrary) {
177181 lu.kind = LinkUnit::SharedLibrary;
182+ #if defined(_WIN32)
183+ lu.output = std::filesystem::path (" bin" ) / std::format (" {}.dll" , t.name );
184+ #else
178185 lu.output = std::filesystem::path (" bin" ) / std::format (" lib{}.so" , t.name );
186+ #endif
179187 } else if (t.kind == mcpp::manifest::Target::TestBinary) {
180188 lu.kind = LinkUnit::TestBinary;
181189#if defined(_WIN32)
Original file line number Diff line number Diff line change @@ -1135,15 +1135,15 @@ prepare_build(bool print_fingerprint,
11351135 // macOS: LLVM/Clang — Apple doesn't ship GCC; upstream LLVM with
11361136 // bundled libc++ is the self-contained choice.
11371137 // Linux: musl-gcc — produces portable static binaries.
1138- #if defined(__APPLE__)
1138+ #if defined(__APPLE__) || defined(_WIN32)
11391139 std::string defaultSpec = " llvm@20.1.7" ;
11401140#else
11411141 std::string defaultSpec = " gcc@15.1.0-musl" ;
11421142#endif
11431143 auto defaultParsed = mcpp::toolchain::parse_toolchain_spec (defaultSpec);
11441144 auto defaultPkg = mcpp::toolchain::to_xim_package (*defaultParsed);
11451145
1146- #if defined(__APPLE__)
1146+ #if defined(__APPLE__) || defined(_WIN32)
11471147 mcpp::ui::info (" First run" ,
11481148 std::format (" no toolchain configured — installing {} (LLVM/Clang) as default" ,
11491149 defaultSpec));
Original file line number Diff line number Diff line change @@ -257,7 +257,8 @@ probe_compiler_binary(const std::filesystem::path& explicit_compiler) {
257257 if (!bin_path_r) {
258258 return std::unexpected (DetectError{std::format (" compiler '{}' not found in PATH" , cxx)});
259259 }
260- auto bin = trim_line (*bin_path_r);
260+ // `where` on Windows may return multiple lines; take only the first.
261+ auto bin = trim_line (first_line_of (*bin_path_r));
261262 if (bin.empty ()) {
262263 return std::unexpected (DetectError{std::format (" compiler '{}' not found" , cxx)});
263264 }
You can’t perform that action at this time.
0 commit comments