Skip to content

Commit 84c52ff

Browse files
committed
Add windows support
1 parent 4e19882 commit 84c52ff

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ all: build-kernel test
77
build-kernel:
88
cd depend/bitcoin && \
99
cmake -B build \
10+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
1011
-DBUILD_SHARED_LIBS=ON \
1112
-DBUILD_KERNEL_LIB=ON \
1213
-DBUILD_KERNEL_TEST=OFF \
@@ -21,7 +22,7 @@ build-kernel:
2122
-DBUILD_UTIL_CHAINSTATE=OFF \
2223
-DBUILD_CLI=OFF \
2324
-DENABLE_IPC=OFF && \
24-
cmake --build build --target bitcoinkernel -j $(shell nproc 2>/dev/null || echo 4)
25+
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
2526

2627
build:
2728
go build ./...

kernel/cgo_unix.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//go:build unix
2+
3+
package kernel
4+
5+
/*
6+
#cgo CFLAGS: -I../depend/bitcoin/src
7+
#cgo LDFLAGS: -L../depend/bitcoin/build/lib -lbitcoinkernel -Wl,-rpath,${SRCDIR}/../depend/bitcoin/build/lib
8+
*/
9+
import "C"

kernel/cgo_windows.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//go:build windows
2+
3+
package kernel
4+
5+
/*
6+
#cgo CFLAGS: -I../depend/bitcoin/src
7+
#cgo LDFLAGS: -L../depend/bitcoin/build/bin/RelWithDebInfo -lbitcoinkernel -lbcrypt -lshell32
8+
*/
9+
import "C"

kernel/kernel.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,3 @@
1616
// resource cleanup and is not recommended for long-running programs or when working
1717
// with many objects.
1818
package kernel
19-
20-
/*
21-
#cgo CFLAGS: -I../depend/bitcoin/src
22-
#cgo LDFLAGS: -L../depend/bitcoin/build/lib -lbitcoinkernel -Wl,-rpath,${SRCDIR}/../depend/bitcoin/build/lib
23-
*/
24-
import "C"

0 commit comments

Comments
 (0)