File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,18 @@ cmake-ts can build the projects with built-in configurations that are selected d
2424cmake-ts build --config debug
2525```
2626
27- You can cross-compile by specifying the built-in cross configs
27+ You can cross-compile by specifying the built-in cross configs:
2828
2929``` bash
3030cmake-ts build --config cross-win32-arm64-release
3131```
3232
33+ Or by specifying the ` npm_config_target_os ` and ` npm_config_target_arch ` environment variables:
34+
35+ ``` bash
36+ npm_config_target_os=linux npm_config_target_arch=arm64 cmake-ts build
37+ ```
38+
3339### CLI Arguments
3440
3541` build ` command:
@@ -81,11 +87,11 @@ Options:
8187 - ` darwin-arm64-node-release`
8288 - ` darwin-arm64-electron-relwithdebinfo`
8389
84- To explicitly indicate cross-compilation, prefix the config name with \ ` cross-\ ` :
90+ To explicitly indicate cross-compilation, prefix the config name with ` cross-` :
8591
86- - \ ` cross-win32-ia32-node-release\ `
87- - \ ` cross-linux-arm64-node-release\ `
88- - \ ` cross-darwin-x64-electron-relwithdebinfo\ `
92+ - ` cross-win32-ia32-node-release`
93+ - ` cross-linux-arm64-node-release`
94+ - ` cross-darwin-x64-electron-relwithdebinfo`
8995
9096 You can also define your own configs in the config file (package.json).
9197
Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ export async function getBuildConfig(
6666 config . arch ??= globalConfig . arch ?? process . arch
6767 config . cross ??=
6868 globalConfig . cross ??
69- ( process . platform !== config . os ||
70- ( process . env . npm_config_target_os !== undefined && process . env . npm_config_target_os !== config . os ) ||
71- process . arch !== config . arch ||
72- ( process . env . npm_config_target_arch !== undefined && process . env . npm_config_target_arch !== config . arch ) )
69+ ( ( process . env . npm_config_target_os !== undefined && process . env . npm_config_target_os !== config . os ) ||
70+ ( process . env . npm_config_target_arch !== undefined && process . env . npm_config_target_arch !== config . arch ) ||
71+ process . platform !== config . os ||
72+ process . arch !== config . arch )
7373
7474 // Runtime
7575
You can’t perform that action at this time.
0 commit comments