Skip to content
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,43 @@ jobs:
- name: Run tests
run: make test

windows:
name: Build and Test on Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.3'

- name: Install Boost library
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg install boost-multi-index:x64-windows boost-headers:x64-windows

- name: Set environment variables
run: |
echo "BOOST_ROOT=$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "BOOST_INCLUDEDIR=$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows\include" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "$env:GITHUB_WORKSPACE\depend\bitcoin\build\bin\RelWithDebInfo" | Out-File -FilePath $env:GITHUB_PATH -Append

- name: Install make
run: choco install make

- name: Build Kernel
run: make build-kernel

- name: Build
run: make build

- name: Run tests
run: make test

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ all: build-kernel test
build-kernel:
cd depend/bitcoin && \
cmake -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_KERNEL_LIB=ON \
-DBUILD_KERNEL_TEST=OFF \
Expand All @@ -21,7 +22,7 @@ build-kernel:
-DBUILD_UTIL_CHAINSTATE=OFF \
-DBUILD_CLI=OFF \
-DENABLE_IPC=OFF && \
cmake --build build --target bitcoinkernel -j $(shell nproc 2>/dev/null || echo 4)
cmake --build build --config RelWithDebInfo --parallel$(if $(NUM_JOBS),=$(NUM_JOBS)) # Use NUM_JOBS variable if set (e.g., make build-kernel NUM_JOBS=8), otherwise auto-detect CPU cores

build:
go build ./...
Expand Down
9 changes: 9 additions & 0 deletions kernel/cgo_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build unix

package kernel

/*
#cgo CFLAGS: -I../depend/bitcoin/src
#cgo LDFLAGS: -L../depend/bitcoin/build/lib -lbitcoinkernel -Wl,-rpath,${SRCDIR}/../depend/bitcoin/build/lib
*/
import "C"
9 changes: 9 additions & 0 deletions kernel/cgo_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build windows

package kernel

/*
#cgo CFLAGS: -I../depend/bitcoin/src
#cgo LDFLAGS: -L../depend/bitcoin/build/bin/RelWithDebInfo -lbitcoinkernel -lbcrypt -lshell32
*/
import "C"
6 changes: 0 additions & 6 deletions kernel/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@
// resource cleanup and is not recommended for long-running programs or when working
// with many objects.
package kernel

/*
#cgo CFLAGS: -I../depend/bitcoin/src
#cgo LDFLAGS: -L../depend/bitcoin/build/lib -lbitcoinkernel -Wl,-rpath,${SRCDIR}/../depend/bitcoin/build/lib
*/
import "C"
Loading