diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 668a01a9..e081b969 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,9 @@ jobs: include: - os: ubuntu-latest build-group: linux-x64 - - os: macos-latest - build-group: darwin-x64 + # At the time of writing macos-latest is mac 10; we need 11 to build a universal binary. + - os: macos-11 + build-group: darwin-x64+arm64 - os: windows-latest build-group: win32-x64 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8a9caf0..a647deb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,8 @@ jobs: test: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # At the time of writing macos-latest is mac 10; we need 11 to build a universal binary. + os: [ubuntu-latest, macos-11, windows-latest] node: [10, 12, 14] runs-on: ${{ matrix.os }} name: ${{ matrix.os }} / Node ${{ matrix.node }} diff --git a/binding.gyp b/binding.gyp index 976e7cb0..0ecee2ab 100644 --- a/binding.gyp +++ b/binding.gyp @@ -41,8 +41,14 @@ '-mmacosx-version-min=10.8' , '-std=c++11' , '-stdlib=libc++' + , '-arch x86_64' + , '-arch arm64' + ] + , 'OTHER_LDFLAGS': [ + '-stdlib=libc++' + , '-arch x86_64' + , '-arch arm64' ] - , 'OTHER_LDFLAGS': ['-stdlib=libc++'] , 'GCC_ENABLE_CPP_RTTI': 'YES' , 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' , 'MACOSX_DEPLOYMENT_TARGET': '10.8' diff --git a/deps/rocksdb/rocksdb.gyp b/deps/rocksdb/rocksdb.gyp index c5f66637..523543f9 100644 --- a/deps/rocksdb/rocksdb.gyp +++ b/deps/rocksdb/rocksdb.gyp @@ -166,6 +166,8 @@ , '-stdlib=libc++' , '-fno-omit-frame-pointer' , '-momit-leaf-frame-pointer' + , '-arch x86_64' + , '-arch arm64' ] # , 'OTHER_LDFLAGS': ['-stdlib=libc++'] , 'GCC_ENABLE_CPP_RTTI': 'YES' @@ -376,6 +378,7 @@ , 'rocksdb/util/compression_context_cache.cc' , 'rocksdb/util/concurrent_task_limiter_impl.cc' , 'rocksdb/util/crc32c.cc' + , 'rocksdb/util/crc32c_arm64.cc' , 'rocksdb/util/dynamic_bloom.cc' , 'rocksdb/util/hash.cc' , 'rocksdb/util/murmurhash.cc' diff --git a/deps/snappy/snappy.gyp b/deps/snappy/snappy.gyp index 1041e4fb..2c898cfa 100644 --- a/deps/snappy/snappy.gyp +++ b/deps/snappy/snappy.gyp @@ -71,6 +71,10 @@ '-Wno-sign-compare' , '-Wno-unused-function' ] + , 'OTHER_CFLAGS': [ + '-arch x86_64' + , '-arch arm64' + ] } }] ] diff --git a/package.json b/package.json index 8241ce5f..edb8ef17 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "rebuild": "npm run install --build-from-source", "prebuild": "prebuildify -t 8.14.0 --napi --strip", "prebuild-linux-x64": "prebuildify-cross -i centos7-devtoolset7 -i alpine -t 8.14.0 --napi --strip", - "prebuild-darwin-x64": "prebuildify -t 8.14.0 --napi --strip", + "prebuild-darwin-x64+arm64": "prebuildify -t 8.14.0 --napi --strip --arch x64+arm64", "prebuild-win32-x64": "prebuildify -t 8.14.0 --napi --strip", "download-prebuilds": "prebuildify-ci download", "hallmark": "hallmark --fix", @@ -24,7 +24,7 @@ "dependencies": { "abstract-leveldown": "^7.0.0", "napi-macros": "^2.0.0", - "node-gyp-build": "^4.2.3" + "node-gyp-build": "^4.3.0" }, "devDependencies": { "async-each": "^1.0.3", @@ -40,7 +40,7 @@ "mkfiletree": "^2.0.0", "node-gyp": "^7.1.2", "nyc": "^15.0.0", - "prebuildify": "^4.1.1", + "prebuildify": "^4.2.1", "prebuildify-ci": "^1.0.4", "prebuildify-cross": "^4.0.1", "readfiletree": "^1.0.0",