summaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorChelsea Holland Komlo <me@chelseakomlo.com>2017-10-12 17:29:51 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-27 10:02:08 -0400
commit0c4d535972bcf14fec0b65c82359db28b0cc0091 (patch)
treef7ab90fcf661b29bc1e80cfa16c21832d8eae3db /src/rust
parentbe583a34a3815c2c10e86094ab0610e4b7f9c869 (diff)
downloadtor-0c4d535972bcf14fec0b65c82359db28b0cc0091.tar.gz
tor-0c4d535972bcf14fec0b65c82359db28b0cc0091.zip
refactor build infrastructure for single rust binary
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/Cargo.lock8
-rw-r--r--src/rust/Cargo.toml2
-rw-r--r--src/rust/include.am3
-rw-r--r--src/rust/tor_rust/Cargo.toml16
-rw-r--r--src/rust/tor_rust/include.am12
-rw-r--r--src/rust/tor_rust/lib.rs5
-rw-r--r--src/rust/tor_util/include.am13
7 files changed, 43 insertions, 16 deletions
diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock
index 56cb9d76ba..a5686979fa 100644
--- a/src/rust/Cargo.lock
+++ b/src/rust/Cargo.lock
@@ -42,5 +42,13 @@ dependencies = [
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "tor_rust"
+version = "0.1.0"
+dependencies = [
+ "protover 0.0.1",
+ "tor_util 0.0.1",
+]
+
[metadata]
"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502"
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
index 5d4292bbd3..953c9b96b7 100644
--- a/src/rust/Cargo.toml
+++ b/src/rust/Cargo.toml
@@ -1,5 +1,5 @@
[workspace]
-members = ["tor_util", "protover", "smartlist", "external", "tor_allocate"]
+members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust"]
[profile.release]
debug = true
diff --git a/src/rust/include.am b/src/rust/include.am
index 716d46f4cc..025d921b31 100644
--- a/src/rust/include.am
+++ b/src/rust/include.am
@@ -1,5 +1,4 @@
-include src/rust/tor_util/include.am
-include src/rust/protover/include.am
+include src/rust/tor_rust/include.am
EXTRA_DIST +=\
src/rust/Cargo.toml \
diff --git a/src/rust/tor_rust/Cargo.toml b/src/rust/tor_rust/Cargo.toml
new file mode 100644
index 0000000000..86fad3ee76
--- /dev/null
+++ b/src/rust/tor_rust/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+authors = ["The Tor Project"]
+name = "tor_rust"
+version = "0.1.0"
+
+[lib]
+name = "tor_rust"
+path = "lib.rs"
+crate_type = ["rlib", "staticlib"]
+
+[dependencies.tor_util]
+path = "../tor_util"
+
+[dependencies.protover]
+path = "../protover"
+
diff --git a/src/rust/tor_rust/include.am b/src/rust/tor_rust/include.am
new file mode 100644
index 0000000000..7d30592b07
--- /dev/null
+++ b/src/rust/tor_rust/include.am
@@ -0,0 +1,12 @@
+EXTRA_DIST +=\
+ src/rust/tor_rust/Cargo.toml \
+ src/rust/tor_rust/lib.rs \
+ src/rust/tor_rust/tor_rust.rs
+
+src/rust/target/release/@TOR_RUST_STATIC_NAME@: FORCE
+ ( cd "$(abs_top_srcdir)/src/rust/tor_rust" ; \
+ CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \
+ CARGO_HOME="$(abs_top_builddir)/src/rust" \
+ $(CARGO) build --release --quiet $(CARGO_ONLINE) )
+
+FORCE:
diff --git a/src/rust/tor_rust/lib.rs b/src/rust/tor_rust/lib.rs
new file mode 100644
index 0000000000..c1585c0480
--- /dev/null
+++ b/src/rust/tor_rust/lib.rs
@@ -0,0 +1,5 @@
+extern crate tor_util;
+extern crate protover;
+
+pub use tor_util::*;
+pub use protover::*;
diff --git a/src/rust/tor_util/include.am b/src/rust/tor_util/include.am
deleted file mode 100644
index ec3898577b..0000000000
--- a/src/rust/tor_util/include.am
+++ /dev/null
@@ -1,13 +0,0 @@
-EXTRA_DIST +=\
- src/rust/tor_util/Cargo.toml \
- src/rust/tor_util/lib.rs \
- src/rust/tor_util/ffi.rs \
- src/rust/tor_util/rust_string.rs
-
-src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@: FORCE
- ( cd "$(abs_top_srcdir)/src/rust/tor_util" ; \
- CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \
- CARGO_HOME="$(abs_top_builddir)/src/rust" \
- $(CARGO) build --release --quiet $(CARGO_ONLINE) )
-
-FORCE: