From ca0ceca9e940536a971d8ae8e3f66c1ff9c4113c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Isager=20Dalsgar=C3=B0?= Date: Fri, 18 Oct 2024 21:17:44 +0200 Subject: [PATCH] Switch to `bare-make` --- .github/workflows/prebuild.yml | 24 +++++++++++++++++------- .github/workflows/test.yml | 6 ++++-- CMakeLists.txt | 22 ++++++++++++---------- package.json | 1 + 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 77a42c9..84af81a 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -15,20 +15,16 @@ jobs: - os: ubuntu-22.04 platform: android arch: x64 - flags: --android-ndk 26.1.10909125 --android-api 34 - os: ubuntu-22.04 platform: android arch: ia32 - flags: --android-ndk 26.1.10909125 --android-api 34 - os: ubuntu-22.04 platform: android arch: arm64 - flags: --android-ndk 26.1.10909125 --android-api 34 - os: ubuntu-22.04 platform: android arch: arm - flags: --android-ndk 26.1.10909125 --android-api 34 - - os: macos-12 + - os: macos-14 platform: darwin arch: x64 - os: macos-14 @@ -66,10 +62,24 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - run: npm install -g bare-runtime bare-dev + - run: npm install -g bare-runtime bare-make - run: npm install - - run: bare-dev install --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }} + - run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }} + - run: bare-make build + - run: bare-make install - uses: actions/upload-artifact@v4 with: name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }} path: prebuilds/* + merge: + runs-on: ubuntu-latest + needs: prebuild + steps: + - uses: actions/download-artifact@v4 + with: + path: prebuilds + merge-multiple: true + - uses: actions/upload-artifact@v4 + with: + name: prebuilds + path: prebuilds diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6710858..79304c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - run: npm install -g bare-runtime bare-dev + - run: npm install -g bare-runtime bare-make - run: npm install - - run: bare-dev install --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug + - run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug + - run: bare-make build + - run: bare-make install - run: npm test diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e0d693..ea1ed33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,24 @@ cmake_minimum_required(VERSION 3.25) +find_package(cmake-bare REQUIRED PATHS node_modules/cmake-bare) + set(CMAKE_MACOSX_BUNDLE OFF) project(bare_crypto C) -include(bare) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +bare_target(target) -if(NOT TARGET ssl) - if(MSVC) - set(OPENSSL_NO_ASM ON) - endif() +if(target MATCHES "win32") + add_definitions(-DWIN32_LEAN_AND_MEAN) +endif() - if(WIN32) - add_definitions(-DWIN32_LEAN_AND_MEAN) - endif() +if(target MATCHES "win32-x64") + set(OPENSSL_NO_ASM ON) +else() + enable_language(ASM) +endif() +if(NOT TARGET ssl) add_subdirectory(vendor/boringssl EXCLUDE_FROM_ALL) endif() diff --git a/package.json b/package.json index e0a9745..b0cb2bd 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ }, "devDependencies": { "brittle": "^3.5.0", + "cmake-bare": "^1.1.6", "standard": "^17.0.0" } }