Unverified Commit 4a8748c5 authored by Connor's avatar Connor Committed by GitHub

add update titan script (#359)

* add update titan script
Signed-off-by: 's avatarConnor1996 <zbk602423539@gmail.com>
parent 123e9edf
...@@ -20,6 +20,7 @@ jemalloc = ["librocksdb_sys/jemalloc"] ...@@ -20,6 +20,7 @@ jemalloc = ["librocksdb_sys/jemalloc"]
portable = ["librocksdb_sys/portable"] portable = ["librocksdb_sys/portable"]
sse = ["librocksdb_sys/sse"] sse = ["librocksdb_sys/sse"]
valgrind = [] valgrind = []
update_titan = ["librocksdb_sys/update_titan"]
[dependencies] [dependencies]
libc = "0.2.11" libc = "0.2.11"
......
...@@ -14,3 +14,12 @@ clean: ...@@ -14,3 +14,12 @@ clean:
@cargo clean @cargo clean
@cd librocksdb_sys && cargo clean @cd librocksdb_sys && cargo clean
update_titan:
@if [ -n "${TITAN_REPO}" ]; then \
git config --file=.gitmodules submodule.titan.url https://github.com/${TITAN_REPO}/titan.git; \
fi
@if [ -n "${TITAN_BRANCH}" ]; then \
git config --file=.gitmodules submodule.titan.branch ${TITAN_BRANCH}; \
fi
@git submodule sync
@git submodule update --remote librocksdb_sys/libtitan_sys/titan
\ No newline at end of file
...@@ -19,6 +19,7 @@ jemalloc = ["jemalloc-sys"] ...@@ -19,6 +19,7 @@ jemalloc = ["jemalloc-sys"]
# when not using with static-link right now in this crate. # when not using with static-link right now in this crate.
portable = ["libtitan_sys/portable"] portable = ["libtitan_sys/portable"]
sse = ["libtitan_sys/sse"] sse = ["libtitan_sys/sse"]
update_titan = ["libtitan_sys/update_titan"]
[build-dependencies] [build-dependencies]
cc = "1.0.3" cc = "1.0.3"
......
...@@ -13,6 +13,7 @@ default = [] ...@@ -13,6 +13,7 @@ default = []
# when not using with static-link right now in this crate. # when not using with static-link right now in this crate.
portable = [] portable = []
sse = [] sse = []
update_titan = []
[build-dependencies] [build-dependencies]
cc = "1.0.3" cc = "1.0.3"
......
...@@ -2,6 +2,7 @@ extern crate cc; ...@@ -2,6 +2,7 @@ extern crate cc;
extern crate cmake; extern crate cmake;
use std::env; use std::env;
use std::process::Command;
fn main() { fn main() {
// RocksDB cmake script expect libz.a being under ${DEP_Z_ROOT}/lib, but libz-sys crate put it // RocksDB cmake script expect libz.a being under ${DEP_Z_ROOT}/lib, but libz-sys crate put it
...@@ -22,6 +23,13 @@ fn main() { ...@@ -22,6 +23,13 @@ fn main() {
if cfg!(feature = "sse") { if cfg!(feature = "sse") {
cfg.define("FORCE_SSE42", "ON"); cfg.define("FORCE_SSE42", "ON");
} }
if cfg!(feature = "update_titan") {
Command::new("make")
.current_dir("../..")
.args(&["update_titan"])
.status()
.expect("failed to update titan!");
}
let dst = cfg let dst = cfg
.define("ROCKSDB_DIR", cur_dir.join("..").join("rocksdb")) .define("ROCKSDB_DIR", cur_dir.join("..").join("rocksdb"))
.define("WITH_TITAN_TESTS", "OFF") .define("WITH_TITAN_TESTS", "OFF")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment