Skip to content

Commit

Permalink
Add examples for targets and arch
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 20, 2020
1 parent 543aead commit 581409c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,20 @@ Options can be provided via (in order of precedence) the programmatic API, the C

\* A target takes the form of `(runtime@)?version`, where `runtime` defaults to `'node'`. For example: `-t 8.14.0 -t [email protected]`. At least one of `--target`, `--all` or `--napi` must be specified.

```
prebuildify --napi # all the napi versions that are supported by Node
prebuildify --napi --electron-compat # all the napi versions that are supported by Node or Electron
prebuildify --all # all the targets
prebuildify -t 8.14.0 -t [email protected] # specific targets
```

\*\* The `arch` option is passed to [`node-gyp`][node-gyp] as `--target-arch`. Target architecture and platform (what you're building _for_) default to the host platform and architecture (what you're building _on_). They can be overridden for cross-compilation, in which case you'll likely also want to override the strip binary. The platform and architecture dictate the output folder. For example on Linux x64 prebuilds end up in `prebuilds/linux-x64`.

```
prebuildify --napi --electron-compat # uses the architecture of running process
prebuildify --arch=ia32 --napi --electron-compat # windows x86 architecture
```

\*\*\* The filenames of prebuilds are composed of _tags_ which by default include runtime and either `napi` or `abi<version>`. For example: `electron.abi40.node`. To make more specific prebuilds (for `node-gyp-build` to select) you can add additional tags. Values for these tags are auto-detected. For example, `--napi --tag-uv --tag-armv` could result in a build called `node.napi.uv1.armv8.node` if the host machine has an ARM architecture. When cross-compiling you can override values either through the relevant option (`--tag-armv --armv 7`) or the tag (`--tag-armv 7`) as a shortcut. They're separate because you may want to build a certain version without tagging the prebuild as such, assuming that the prebuild is forward compatible.

\*\*\*\* To enable the use of forks like [`nodejs-mobile-gyp`](https://www.npmjs.com/package/nodejs-mobile-gyp).
Expand Down

0 comments on commit 581409c

Please sign in to comment.