Skip to content

Commit

Permalink
Switch to bare-make
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Oct 18, 2024
1 parent 8a80175 commit ca0ceca
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"devDependencies": {
"brittle": "^3.5.0",
"cmake-bare": "^1.1.6",
"standard": "^17.0.0"
}
}

0 comments on commit ca0ceca

Please sign in to comment.