Skip to content

Commit

Permalink
initial windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Nov 27, 2024
1 parent 7fc1c74 commit 24905ea
Show file tree
Hide file tree
Showing 4 changed files with 2,317 additions and 2,691 deletions.
25 changes: 3 additions & 22 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fn secp256k1_build() {
.flag_if_supported("-Wno-unused-parameter") // patching out printf causes this warning
//.define("SECP256K1_API", Some(""))
.define("ENABLE_MODULE_ECDH", Some("1"))
.define("SECP256K1_STATIC", Some("1"))
.define("ENABLE_MODULE_SCHNORRSIG", Some("1"))
.define("ENABLE_MODULE_EXTRAKEYS", Some("1"));
//.define("ENABLE_MODULE_ELLSWIFT", Some("1"))
Expand Down Expand Up @@ -50,30 +51,11 @@ fn main() {
build
.files([
"nostrdb/src/nostrdb.c",
"nostrdb/src/bolt11/bolt11.c",
"nostrdb/src/bolt11/amount.c",
"nostrdb/src/bolt11/bech32.c",
"nostrdb/src/bolt11/hash_u5.c",
"nostrdb/src/invoice.c",
"nostrdb/src/nostr_bech32.c",
"nostrdb/src/content_parser.c",
"nostrdb/ccan/ccan/crypto/sha256/sha256.c",
//"nostrdb/ccan/ccan/htable/htable.c",
//"nostrdb/ccan/ccan/htable/tools/density.c",
//"nostrdb/ccan/ccan/htable/tools/hsearchspeed.c",
//"nostrdb/ccan/ccan/htable/tools/speed.c",
//"nostrdb/ccan/ccan/htable/tools/stringspeed.c",
"nostrdb/ccan/ccan/likely/likely.c",
"nostrdb/ccan/ccan/list/list.c",
"nostrdb/ccan/ccan/mem/mem.c",
"nostrdb/ccan/ccan/str/debug.c",
"nostrdb/ccan/ccan/str/str.c",
"nostrdb/ccan/ccan/take/take.c",
//"nostrdb/ccan/ccan/tal/benchmark/samba-allocs.c",
//"nostrdb/ccan/ccan/tal/benchmark/speed.c",
"nostrdb/ccan/ccan/tal/str/str.c",
"nostrdb/ccan/ccan/tal/tal.c",
"nostrdb/ccan/ccan/utf8/utf8.c",
"nostrdb/src/bolt11/bech32.c",
"nostrdb/src/block.c",
"nostrdb/deps/flatcc/src/runtime/json_parser.c",
"nostrdb/deps/flatcc/src/runtime/verifier.c",
Expand All @@ -83,6 +65,7 @@ fn main() {
"nostrdb/deps/lmdb/mdb.c",
"nostrdb/deps/lmdb/midl.c",
])
.define("SECP256K1_STATIC", Some("1"))
.include("nostrdb/deps/lmdb")
.include("nostrdb/deps/flatcc/include")
.include("nostrdb/deps/secp256k1/include")
Expand Down Expand Up @@ -111,8 +94,6 @@ fn main() {
println!("cargo:rerun-if-changed={}", file);
}

println!("cargo:rustc-link-lib=secp256k1");

// Print out the path to the compiled library
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
println!("cargo:rustc-link-search=native={}", out_path.display());
Expand Down
2 changes: 1 addition & 1 deletion nostrdb
Loading

0 comments on commit 24905ea

Please sign in to comment.