Skip to content

Commit 26d1bb3

Browse files
committed
Support C++26 toolchain on macOS
1 parent 8d3d2a2 commit 26d1bb3

File tree

3 files changed

+607
-474
lines changed

3 files changed

+607
-474
lines changed

src/frontend/cxx/frontend.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,16 @@ auto runOnFile(const CLI& cli, const std::string& fileName) -> bool {
117117
}
118118

119119
if (toolchainId == "darwin" || toolchainId == "macos") {
120-
toolchain = std::make_unique<MacOSToolchain>(preprocesor);
120+
auto macosToolchain = std::make_unique<MacOSToolchain>(preprocesor);
121+
std::string host;
122+
#ifdef __aarch64__
123+
host = "aarch64";
124+
#elif __x86_64__
125+
host = "x86_64";
126+
#endif
127+
macosToolchain->setArch(cli.getSingle("-arch").value_or(host));
128+
toolchain = std::move(macosToolchain);
129+
121130
} else if (toolchainId == "wasm32") {
122131
auto wasmToolchain = std::make_unique<Wasm32WasiToolchain>(preprocesor);
123132

0 commit comments

Comments
 (0)