Skip to content

Commit

Permalink
fix(rust): correct CARGO_TARGET_LINKER compiler name on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
deciduously committed Jan 10, 2025
1 parent d07faa7 commit 3e5ba23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rust/cargo.tg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ export const build = tg.target(async (...args: std.Args<Arg>) => {
);

// When not cross-compiling, ensure the `gcc` provided by the SDK is used, which enables Tangram linking.
let compilerName = "gcc";
if (os === "darwin") {
compilerName = "clang";
}
let toolchainEnv = {
[`CARGO_TARGET_${tripleToEnvVar(target, true)}_LINKER`]: `gcc`,
[`CARGO_TARGET_${tripleToEnvVar(target, true)}_LINKER`]: compilerName,
};

// If cross-compiling, set additional environment variables.
Expand Down

0 comments on commit 3e5ba23

Please sign in to comment.