precompile and cache Carbon prelude (#7432)

Refactors the link driver to automatically compile and cache the carbon
prelude for use in linking.

Implements a `carbon_library` rule for compiling the Core library
dependencies in the examples.
This commit is contained in:
Lucile Rose Nihlen
2026-07-16 18:02:14 +00:00
committed by GitHub
parent 90f6654b48
commit 625f2ca629
63 changed files with 1454 additions and 634 deletions
+5 -2
View File
@@ -116,7 +116,9 @@ class InProcessCompiler {
auto RunCompile(llvm::StringRef file_name, Phase phase) -> bool {
if constexpr (L == Lang::Carbon) {
return driver_->RunCommand({"compile", PhaseFlag(phase), file_name})
return driver_
->RunCommand({"compile", PhaseFlag(phase), "--no-include-carbon-core",
file_name})
.success;
}
@@ -204,7 +206,8 @@ class SubprocessCompiler {
if constexpr (L == Lang::Carbon) {
program = carbon_path_;
args = {"carbon", "compile", PhaseFlag(phase), file_name};
args = {"carbon", "compile", PhaseFlag(phase), "--no-include-carbon-core",
file_name};
} else {
program = clang_path_;
args = {"clang++", "--driver-mode=g++"};