From f6772f6a39f7072a64b0b75c99d7a7b702db2d60 Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Mon, 4 Jul 2022 20:33:21 +0800 Subject: [PATCH] move around --- .gitignore | 3 ++- .gitmodules | 2 +- cozorocks/Cargo.toml | 1 + cozorocks/build.rs | 10 +++++++--- rocksdb | 1 - 5 files changed, 11 insertions(+), 6 deletions(-) delete mode 160000 rocksdb diff --git a/.gitignore b/.gitignore index dbcf703f..2cddba5d 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ _deps _test* *.db -deps/ \ No newline at end of file +cozorocks/deps/ +.DS_Store \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 77798ed3..a3a9ba8b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "rocksdb"] - path = rocksdb + path = cozorocks/rocksdb url = https://github.com/facebook/rocksdb diff --git a/cozorocks/Cargo.toml b/cozorocks/Cargo.toml index 8cb2aff2..814637a9 100644 --- a/cozorocks/Cargo.toml +++ b/cozorocks/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] cxx = "1.0.69" +tikv-jemalloc-sys = { "version" = "0.5", "features" = ["unprefixed_malloc_on_supported_platforms"] } [build-dependencies] cxx-build = "1.0.69" \ No newline at end of file diff --git a/cozorocks/build.rs b/cozorocks/build.rs index 68e1ad23..21bf8f13 100644 --- a/cozorocks/build.rs +++ b/cozorocks/build.rs @@ -1,6 +1,10 @@ +use std::env::var; + fn main() { - println!("cargo:rustc-link-search=../deps/lib/"); - println!("cargo:rustc-link-search=/opt/homebrew/lib/"); + let manifest_dir = var("CARGO_MANIFEST_DIR").unwrap(); + + // println!("cargo:rustc-link-search=/opt/homebrew/lib/"); + println!("cargo:rustc-link-search={}/deps/lib/", manifest_dir); println!("cargo:rustc-link-lib=rocksdb"); println!("cargo:rustc-link-lib=z"); println!("cargo:rustc-link-lib=bz2"); @@ -23,7 +27,7 @@ fn main() { cxx_build::bridge("src/bridge/mod.rs") .files(["bridge/status.cpp", "bridge/db.cpp", "bridge/tx.cpp"]) - .include("../deps/include") + .include("deps/include") .include("bridge") .flag_if_supported("-std=c++17") .compile("cozorocks"); diff --git a/rocksdb b/rocksdb deleted file mode 160000 index 8e0f4952..00000000 --- a/rocksdb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e0f495253f62904a4ca6d3ec6a03391a12b0a45