Skip to content

Commit

Permalink
Giving this a whirl
Browse files Browse the repository at this point in the history
  • Loading branch information
davisp committed Nov 8, 2024
1 parent 8aeef9e commit f15765e
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 17 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"tiledb/proc-macro",
"tiledb/queries",
"tiledb/sys",
"tiledb/sys-cfg",
"tiledb/sys-defs",
"tiledb/utils",
"test-utils/cells",
Expand Down Expand Up @@ -56,6 +57,7 @@ tiledb-pod = { path = "tiledb/pod", version = "0.1.0" }
tiledb-proc-macro = { path = "tiledb/proc-macro", version = "0.1.0" }
tiledb-proptest-config = { path = "test-utils/proptest-config", version = "0.1.0" }
tiledb-sys = { path = "tiledb/sys", version = "0.1.0" }
tiledb-sys-cfg = { path = "tiledb/sys-cfg", version = "0.1.0" }
tiledb-sys-defs = { path = "tiledb/sys-defs", version = "0.1.0" }
tiledb-test-utils = { path = "tiledb/test-utils", version = "0.1.0" }
tiledb-utils = { path = "tiledb/utils", version = "0.1.0" }
Expand Down
3 changes: 3 additions & 0 deletions tiledb/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ tiledb-pod = { workspace = true, features = ["proptest-strategies", "option-subs
tiledb-utils = { workspace = true }
uri = { workspace = true }

[build-dependencies]
tiledb-sys-cfg = { workspace = true }

[features]
default = []
arrow = ["dep:arrow", "dep:serde", "dep:serde_json", "tiledb-common/arrow", "tiledb-common/serde"]
Expand Down
2 changes: 1 addition & 1 deletion tiledb/api/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("cargo:rustc-env=DYLD_FALLBACK_LIBRARY_PATH=/opt/tiledb/lib");
tiledb_sys_cfg::rpath();
}
3 changes: 3 additions & 0 deletions tiledb/queries/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ version.workspace = true
[dependencies]
tiledb-api = { workspace = true }
tiledb-common = { workspace = true }

[build-dependencies]
tiledb-sys-cfg = { workspace = true }
2 changes: 1 addition & 1 deletion tiledb/queries/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("cargo:rustc-env=DYLD_FALLBACK_LIBRARY_PATH=/opt/tiledb/lib");
tiledb_sys_cfg::rpath();
}
8 changes: 8 additions & 0 deletions tiledb/sys-cfg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "tiledb-sys-cfg"
edition.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
tiledb-sys = { workspace = true }
17 changes: 17 additions & 0 deletions tiledb/sys-cfg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// Configure rpath for crates that depend on tiledb-sys
///
/// Any crate that depends on tiledb-sys should call this function in its
/// build.rs so that it rustc is correctly configured. Note that for anyone
/// building static binaries, this is a no-op when tiledb-sys was built
/// statically.
pub fn rpath() {
let libdir = option_env!("DEP_TILEDB_LIBDIR");
if libdir.is_none() {
return;
}

println!(
"cargo:rustc-link-arg=-Wl,-rpath,@loader_path,-rpath,$ORIGIN,-rpath,{}",
libdir.unwrap()
);
}
15 changes: 0 additions & 15 deletions tiledb/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,3 @@ pub use subarray::*;
pub use types::*;
pub use version::*;
pub use vfs::*;

/// Configure rpath for crates that depend on tiledb-sys
///
/// Any crate that depends on tiledb-sys should call this function in its
/// build.rs so that it rustc is correctly configured. Note that for anyone
/// building static binaries, this is a no-op when tiledb-sys was built
/// statically.
pub fn rpath() {
if let Ok(libdir) = std::env::var("DEP_TILEDB_LIBDIR") {
println!(
"cargo:rustc-link-arg=-Wl,-rpath,@loader_path,-rpath,$ORIGIN,-rpath,{}",
libdir
);
}
}

0 comments on commit f15765e

Please sign in to comment.