Skip to content

Commit 4744556

Browse files
committed
deps: the compatibility names compute 0.16.0's answer without importing the toolset module
With mcpp.plugins.toolset in mcpp.deps' re-export chain, GCC 16 emitted no vector<string>::push_back(string&&) for a build program that calls deps::archive::unpack, and its link failed (the Linux archive-consumer row).
1 parent 5372bcd commit 4744556

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎deps/compat/names.cppm‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export module mcpp.deps.compat;
2020
import std;
2121
import mcpp;
2222
import mcpp.plugins.fs;
23-
import mcpp.plugins.toolset;
2423

2524
export namespace mcpp::deps {
2625

@@ -35,6 +34,10 @@ struct compilers {
3534
};
3635

3736
// 0.16.0's answer: mcpp's clang on the Linux libc++ row, nothing elsewhere.
37+
// Computed here rather than through `mcpp.plugins.toolset`: `mcpp.deps`
38+
// re-exports this unit, and with the toolset module in that chain GCC 16
39+
// emitted no `std::vector<std::string>::push_back(std::string&&)` for a build
40+
// program calling `mcpp::deps::archive::unpack` (undefined at its link).
3841
inline compilers program_compilers() {
3942
static bool noted = false;
4043
if (!noted) {
@@ -51,10 +54,11 @@ inline compilers program_compilers() {
5154
|| std::string_view(mcpp::cxx_stdlib()) != "libc++"
5255
|| std::string_view(mcpp::compiler()) != "clang"
5356
|| std::string_view(mcpp::host()) != std::string_view(mcpp::target())) return {};
54-
auto r = mcpp::plugins::toolset::resolve({mcpp::plugins::toolset::source::resolved,
55-
mcpp::plugins::toolset::compiler::row});
56-
if (!r) return {};
57-
return { r->cc, r->cxx };
57+
const std::filesystem::path bin = std::filesystem::path(mcpp::toolchain_dir()) / "bin";
58+
std::error_code ec;
59+
if (!std::filesystem::is_regular_file(bin / "clang++", ec) || !std::filesystem::is_regular_file(bin / "clang", ec))
60+
return {};
61+
return { mcpp::plugins::fs::generic(bin / "clang"), mcpp::plugins::fs::generic(bin / "clang++") };
5862
}
5963

6064
} // namespace mcpp::deps

0 commit comments

Comments
 (0)