building on Windows

main
Ziyang Hu 2 years ago
parent 1545c01892
commit da7b9760e0

@ -17,24 +17,29 @@ fn main() {
let manifest_dir = var("CARGO_MANIFEST_DIR").unwrap(); let manifest_dir = var("CARGO_MANIFEST_DIR").unwrap();
println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/", manifest_dir); if target.contains("msvc") {
println!("cargo:rustc-link-search={}/deps/zstd/lib/", manifest_dir); println!("cargo:rustc-link-search={}/deps/zstd/build/VS2010/bin/x64_Release", manifest_dir);
println!("cargo:rustc-link-search={}/deps/lz4/lib/", manifest_dir); println!("cargo:rustc-link-search={}/deps/lz4/build/VS2017/bin/x64_Release", manifest_dir);
println!("cargo:rustc-link-search={}/deps/jemalloc/lib/", manifest_dir); println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/Release", manifest_dir);
println!("cargo:rustc-link-lib=static=zstd"); println!("cargo:rustc-link-search={}/deps/gflags/cmake_build/lib/Release", manifest_dir);
println!("cargo:rustc-link-lib=static=rocksdb"); println!("cargo:rustc-link-lib=static=rocksdb");
println!("cargo:rustc-link-lib=static=lz4"); println!("cargo:rustc-link-lib=static=gflags_static");
println!("cargo:rustc-link-lib=static=jemalloc"); println!("cargo:rustc-link-lib=libzstd");
// println!("cargo:rustc-link-lib=z"); println!("cargo:rustc-link-lib=static=liblz4_static");
// println!("cargo:rustc-link-lib=rpcrt4");
// if target.contains("msvc") { println!("cargo:rustc-link-lib=shlwapi");
// println!("cargo:rustc-link-lib=rpcrt4"); } else {
// println!("cargo:rustc-link-lib=shlwapi"); println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/", manifest_dir);
// } else if target.contains("darwin") { println!("cargo:rustc-link-search={}/deps/zstd/lib/", manifest_dir);
// println!("cargo:rustc-link-lib=bz2"); println!("cargo:rustc-link-search={}/deps/lz4/lib/", manifest_dir);
// } println!("cargo:rustc-link-search={}/deps/jemalloc/lib/", manifest_dir);
// println!("cargo:rustc-link-lib=static=zstd");
// println!("cargo:rustc-link-lib=snappy"); println!("cargo:rustc-link-lib=static=rocksdb");
println!("cargo:rustc-link-lib=static=lz4");
println!("cargo:rustc-link-lib=static=jemalloc");
}
println!("cargo:rerun-if-changed=src/bridge/mod.rs"); println!("cargo:rerun-if-changed=src/bridge/mod.rs");
println!("cargo:rerun-if-changed=bridge/bridge.h"); println!("cargo:rerun-if-changed=bridge/bridge.h");
println!("cargo:rerun-if-changed=bridge/common.h"); println!("cargo:rerun-if-changed=bridge/common.h");

@ -14,8 +14,8 @@ set (THIRDPARTY_LIBS "") # Initialization, don't touch
# #
set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/gflags/cmake_build) set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/gflags/cmake_build)
set(GFLAGS_INCLUDE ${GFLAGS_HOME}/include) set(GFLAGS_INCLUDE ${GFLAGS_HOME}/include)
set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/lib/libgflags.a) set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/lib/Release/gflags_static.lib)
set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/lib/libgflags.a) set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/lib/Release/gflags_static.lib)
# ================================================== GFLAGS ================================================== # ================================================== GFLAGS ==================================================
# For compatibility # For compatibility
@ -91,10 +91,10 @@ endif ()
# #
# Edit these 4 lines to define paths to LZ4 # Edit these 4 lines to define paths to LZ4
# #
set(LZ4_HOME $ENV{THIRDPARTY_HOME}/lz4/lib) set(LZ4_HOME $ENV{THIRDPARTY_HOME}/lz4)
set(LZ4_INCLUDE ${LZ4_HOME}) set(LZ4_INCLUDE ${LZ4_HOME}/lib)
set(LZ4_LIB_DEBUG ${LZ4_HOME}/liblz4.a) set(LZ4_LIB_DEBUG ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib)
set(LZ4_LIB_RELEASE ${LZ4_HOME}/liblz4.a) set(LZ4_LIB_RELEASE ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib)
# For compatibility # For compatibility
@ -190,10 +190,10 @@ endif ()
# #
# Edit these 4 lines to define paths to ZSTD # Edit these 4 lines to define paths to ZSTD
# #
set(ZSTD_HOME $ENV{THIRDPARTY_HOME}/zstd/lib) set(ZSTD_HOME $ENV{THIRDPARTY_HOME}/zstd)
set(ZSTD_INCLUDE ${ZSTD_HOME}) set(ZSTD_INCLUDE ${ZSTD_HOME}/lib)
set(ZSTD_LIB_DEBUG ${ZSTD_HOME}/libzstd.a) set(ZSTD_LIB_DEBUG ${ZSTD_HOME}/build/VS2010/bin/x64_Release/libzstd.lib)
set(ZSTD_LIB_RELEASE ${ZSTD_HOME}/libzstd.a) set(ZSTD_LIB_RELEASE ${ZSTD_HOME}//build/VS2010/bin/x64_Release/libzstd.lib)
# For compatibility # For compatibility
if (ZSTD) if (ZSTD)

Loading…
Cancel
Save