feat(translation,ide): add native C driver, Ninja custom commands, CMake CXX_MODULES, and vbs ide integration
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s

This commit is contained in:
faumaray committed 2026-11-27 07:50:54 +03:00
1 parent 5e1916dc5c
commit 6c225c2dff
27 files changed
+3443 -331

No files matched your search

+37 -2
View File
@@ -113,7 +113,16 @@ std::string serialize_export(const ProviderExport &exp) {
",\"runtime_files\":" +
json_array(iface.runtime_files,
[](const std::filesystem::path &p) { return json_quote(p.string()); }) +
'}';
",\"module_bmis\":{";
bool first_mod = true;
for (const auto &[mname, bmi_p] : iface.module_bmis) {
if (!first_mod) {
out += ',';
}
first_mod = false;
out += json_quote(mname) + ':' + json_quote(bmi_p.string());
}
out += "}}";
}
out += "}}\n";
return out;
@@ -175,7 +184,16 @@ std::optional<ProviderExport> load_cached_export(const std::filesystem::path &ex
for (const auto &s : get_str_array(*io, "runtime_files")) {
iface.runtime_files.emplace_back(s);
}
// Verify materialized library artifacts still exist on disk!
if (const auto *mv = find_key(*io, "module_bmis")) {
if (const auto *mobj = std::get_if<JsonVal::Object>(&mv->value)) {
for (const auto &[mname, mval] : *mobj) {
if (const auto *ms = std::get_if<std::string>(&mval.value)) {
iface.module_bmis.emplace(mname, *ms);
}
}
}
}
// Verify materialized library and BMI artifacts still exist on disk!
std::error_code ec;
for (const auto &lib : iface.static_libraries) {
if (!std::filesystem::is_regular_file(lib, ec)) {
@@ -187,6 +205,12 @@ std::optional<ProviderExport> load_cached_export(const std::filesystem::path &ex
return std::nullopt;
}
}
for (const auto &[mname, bmi_p] : iface.module_bmis) {
(void)mname;
if (!std::filesystem::is_regular_file(bmi_p, ec)) {
return std::nullopt;
}
}
exp.targets[k] = std::move(iface);
}
}
@@ -254,6 +278,9 @@ run_cmake_provider(const ProviderRequest &request, const std::filesystem::path &
req.arguments.push_back("-G");
req.arguments.push_back("Ninja");
}
if (!request.toolchain.c_compiler.empty()) {
req.arguments.push_back("-DCMAKE_C_COMPILER=" + request.toolchain.c_compiler.string());
}
req.arguments.push_back("-DCMAKE_CXX_COMPILER=" + request.toolchain.cxx_compiler.string());
const std::string cfg =
(request.profile.name == "release" || request.profile.name == "Release") ? "Release"
@@ -706,6 +733,9 @@ run_meson_provider(const ProviderRequest &request, const std::filesystem::path &
for (const auto &[k, v] : request.dependency.options) {
req.arguments.push_back("-D" + k + "=" + meson_option_value(v));
}
if (!request.toolchain.c_compiler.empty()) {
req.environment.set_vars["CC"] = request.toolchain.c_compiler.string();
}
req.environment.set_vars["CXX"] = request.toolchain.cxx_compiler.string();
req.timeout = std::chrono::seconds{180};
auto proc = Platform::run_supervised(req, stop);
@@ -1278,6 +1308,11 @@ run_native_provider(const ProviderRequest &request, const std::filesystem::path
}
}
}
if (sum_it != summary_by_name.end()) {
for (const auto &[mname, bmi_p] : sum_it->second->exported_module_bmis) {
iface.module_bmis.try_emplace(mname, bmi_p);
}
}
}
exp.targets[request.dependency.name + "::" + t.name] = iface;