Skip to content

Commit b193f6c

Browse files
committed
chore: try windows msvc witthout linker directives
1 parent 54acc16 commit b193f6c

File tree

5 files changed

+38
-3
lines changed

5 files changed

+38
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Determine the script's directory and the project root directory
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6+
7+
cd $PROJECT_ROOT/bindings/node
8+
9+
mv $PROJECT_ROOT/.cargo/config.node.cross.toml $PROJECT_ROOT/.cargo/config.toml
10+
11+
npm install -g @napi-rs/cli
12+
13+
napi build --platform --release --target x86_64-unknown-linux-gnu
14+
napi build --platform --release --target aarch64-unknown-linux-gnu
15+
napi build --platform --release --target x86_64-pc-windows-msvc
16+
napi build --platform --release --target x86_64-apple-darwin
17+
napi build --platform --release --target aarch64-apple-darwin
18+
19+
mv $PROJECT_ROOT/.cargo/config.toml $PROJECT_ROOT/.cargo/config.node.cross.toml
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# This assumes we are on mac, for the CI we will be running this in Mac
4+
# linkers needed for cross compiling for linux and windows
5+
brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
6+
brew tap messense/homebrew-macos-cross-toolchains
7+
brew install aarch64-unknown-linux-gnu
8+
brew install mingw-w64
9+
10+
rustup target add x86_64-unknown-linux-gnu
11+
rustup target add aarch64-unknown-linux-gnu
12+
rustup target add x86_64-pc-windows-msvc
13+
rustup target add x86_64-apple-darwin
14+
rustup target add aarch64-apple-darwin

bindings/golang/prover.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ package peerdas_kzg
55
#cgo darwin,arm64 LDFLAGS: ./build/aarch64-apple-darwin/libc_peerdas_kzg.a
66
#cgo linux,amd64 LDFLAGS: ./build/x86_64-unknown-linux-gnu/libc_peerdas_kzg.a
77
#cgo linux,arm64 LDFLAGS: ./build/aarch64-unknown-linux-gnu/libc_peerdas_kzg.a
8-
#cgo windows LDFLAGS: ./build/x86_64-pc-windows-gnu/libc_peerdas_kzg.a -lws2_32 -lntdll -luserenv
8+
#cgo windows LDFLAGS: ./build/x86_64-pc-windows-msvc/libc_peerdas_kzg.a
99
#include "./build/c_peerdas_kzg.h"
1010
*/
1111
import "C"
1212
import "runtime"
1313

14+
// #cgo windows LDFLAGS: ./build/x86_64-pc-windows-gnu/libc_peerdas_kzg.a -lws2_32 -lntdll -luserenv
15+
1416
type ProverContext struct {
1517
_inner *C.ProverContext
1618
}

bindings/nim/nim_code/src/utils.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os
33
const
44
buildDir = "build"
55
universalAppleDarwin = buildDir / "universal-apple-darwin"
6-
x86_64PcWindowsGnu = buildDir / "x86_64-pc-windows-gnu"
6+
x86_64PcWindowsGnu = buildDir / "x86_64-pc-windows-msvc"
77
x86_64UnknownLinuxGnu = buildDir / "x86_64-unknown-linux-gnu"
88
aarch64UnknownLinuxGnu = buildDir / "aarch64-unknown-linux-gnu"
99

scripts/compile_to_native.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ case "$OS" in
122122
# Github runners will return MINGW64_NT-10.0-20348
123123
# so we add a wildcard to match the prefix
124124
MINGW64_NT-*|CYGWIN_NT-*|"Windows")
125-
TARGET_NAME="x86_64-pc-windows-gnu"
125+
TARGET_NAME="x86_64-pc-windows-msvc"
126126
STATIC_LIB_NAME="lib${LIB_NAME}.a"
127127
DYNAMIC_LIB_NAME="${LIB_NAME}.dll"
128128
;;

0 commit comments

Comments
 (0)