Skip to content

Commit caf20e5

Browse files
committed
feat: add cross-compiling Windows arm via cmake-ts v1
1 parent 2a8f826 commit caf20e5

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

.github/workflows/CI.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
os:
1818
- ubuntu-24.04
1919
- windows-2019
20+
- macos-13
2021
node_arch:
2122
- x64
2223
cpp_arch:
@@ -25,37 +26,34 @@ jobs:
2526
- ""
2627
native:
2728
- true
28-
2929
include:
30+
# Windows x86
3031
- os: windows-2019
3132
node_arch: ia32
3233
cpp_arch: amd64_x86
3334
native: true
3435

35-
# - os: windows-2022
36-
# node_arch: x64
37-
# arch: arm64
38-
# cpp_arch: amd64_arm64
39-
40-
- os: macos-13
36+
# Windows Arm64
37+
- os: windows-2022
4138
node_arch: x64
42-
cpp_arch: x64
43-
native: true
39+
arch: arm64
40+
cpp_arch: amd64_arm64
4441

42+
# MacOS Arm64
4543
- os: macos-14
4644
node_arch: arm64
4745
cpp_arch: amd64_arm64
4846
native: true
4947

50-
# Ubuntu x64
48+
# Ubuntu 20.04 x64
5149
- os: ubuntu-24.04
5250
distro: ubuntu
5351
platform: linux/amd64
5452
node_arch: x64
5553
cpp_arch: x64
5654
native: false
5755

58-
# Ubuntu Arm
56+
# Ubuntu 20.04 Arm64
5957
- os: ubuntu-24.04-arm
6058
distro: ubuntu
6159
platform: linux/arm64
@@ -146,14 +144,9 @@ jobs:
146144
architecture: ${{ env.setup_node_arch }}
147145

148146
- name: Build Native
149-
if: ${{ matrix.native && matrix.node_arch != 'ia32' }}
147+
if: ${{ matrix.native }}
150148
run: npm run build.native
151149

152-
- name: Build Native Windows 32
153-
if: ${{ matrix.os == 'windows-2019' && matrix.node_arch == 'ia32' }}
154-
run:
155-
node --enable-source-maps ./node_modules/cmake-ts/build/main.js build --config win32-ia32-release
156-
157150
- name: Use Node 20
158151
if: ${{ matrix.native }}
159152
uses: actions/setup-node@v4

script/install.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,7 @@ function cmakeTs() {
1515
)
1616
}
1717

18-
// Default args
19-
let args = ["nativeonly"]
20-
21-
if (process.arch !== process.env.npm_config_target_arch || process.env.cross_compiling === "true") {
22-
// cross-compilation
23-
if (process.platform === "win32") {
24-
if (process.env.npm_config_target_arch === "ia32") {
25-
args = ["named-configs", "windows-x86"]
26-
} else if (process.env.npm_config_target_arch === "arm64") {
27-
args = ["named-configs", "windows-arm64"]
28-
}
29-
}
30-
}
31-
32-
cp.execFileSync(process.execPath, [cmakeTsPath, ...args], {
18+
cp.execFileSync(process.execPath, [cmakeTsPath, "build"], {
3319
stdio: "inherit",
3420
})
3521
}

0 commit comments

Comments
 (0)