Skip to content

Commit cdc38d6

Browse files
committed
set CC when cross-compiling for linux
I thought just setting the target would do this but it was still calling the system linker...
1 parent 967a7cc commit cdc38d6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ jobs:
4646
targets: ${{ steps.get_target.outputs.target_name }}
4747

4848
- name: Building
49+
if: runner.os == 'Linux' && matrix.arch == 'arm64'
50+
env:
51+
npm_config_arch: ${{ matrix.arch }}
52+
CC: aarch64-linux-gnu-gcc
53+
run: pnpm install
54+
55+
- name: Building
56+
if: ${{ !(runner.os == 'Linux' && matrix.arch == 'arm64') }}
4957
env:
5058
npm_config_arch: ${{ matrix.arch }}
5159
run: pnpm install

build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const { spawn, buildPaths, exists } = require('./shared');
2222
`--manifest-path=${path.join(buildPaths.submodule, 'Cargo.toml')}`,
2323
`--target-dir=${buildPaths.build}`,
2424
'--release'
25-
]);
25+
], {
26+
env: process.env,
27+
});
2628

2729
await fs.copyFile(
2830
buildPaths.exeOut,

0 commit comments

Comments
 (0)