Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support native builds with Node 20 #771

Merged
merged 12 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
matrix:
container: ['node:14.0.0']
node_api_target: ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0']
include:
- container: 'node:16.0.0'
node_api_target: '20.0.0'
container: ${{ matrix.container }}
steps:
- name: Checkout
Expand All @@ -32,7 +35,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019, macos-11]
node_api_target: ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0']
node_api_target: ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0', '20.0.0']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-2019', 'macos-latest']
nodejs: ['14', '16', '17', '18']
nodejs: ['14', '16', '17', '18', '20']
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
22 changes: 17 additions & 5 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"targets": [{
"target_name": "metrics",
"variables": {
"cppstd_ver": "<!(node -pe \"parseInt(process.versions.node.split('.')[0]) >= 20 ? 17 : 11\")"
},
"sources": [
"src/native_ext/util/arena.cpp",
"src/native_ext/util/hex.cpp",
Expand All @@ -17,12 +20,13 @@
"conditions": [
["OS == 'linux'", {
"cflags": [
"-std=c++11",
"-std=c++<(cppstd_ver)",
"-Wall",
"-Werror"
],
"cflags_cc": [
"-Wno-attributes"
"-Wno-attributes",
"-Wno-deprecated-declarations"
]
}],
["OS == 'win'", {
Expand All @@ -31,16 +35,24 @@
],
"defines": [
"NOMINMAX"
]
],
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [
"-std:c++<(cppstd_ver)"
]
}
}
}],
["OS == 'mac'", {
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "10.10",
"OTHER_CFLAGS": [
"-std=c++14",
"-std=c++17",
"-stdlib=libc++",
"-Wall",
"-Werror"
"-Werror",
"-Wno-deprecated-declarations"
]
},
}],
Expand Down
2 changes: 1 addition & 1 deletion scripts/prebuild-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const prebuildify = require('prebuildify');
let targets = process.argv.slice(2);

if (targets.length == 0) {
targets = ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0', '19.0.0'];
targets = ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0', '19.0.0', '20.0.0'];
}

prebuildify({
Expand Down
Loading