[librsvg/rustification] First cut at building the Rust library from Automake
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] First cut at building the Rust library from Automake
- Date: Fri, 28 Oct 2016 01:25:10 +0000 (UTC)
commit d4247fc059c7c990475d7b29a6f9a46eca07e4bb
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 27 19:02:15 2016 -0500
First cut at building the Rust library from Automake
This uses a .PHONY rule to just run cargo every time. There is no
addition to "make clean" yet.
The resulting librsvg_internals.so is trivially linked into the LIBADD
for the main librsvg library.
I don't know how to handle "cargo build --release" just for the final
version, while "cargo build" normally. For the C stuff I just pass
CFLAGS by hand to autogen.sh.
This is not integrated into configure.ac yet!
Makefile.am | 8 ++++++++
rust/Cargo.toml | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6206c59..50d5015 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,6 +72,13 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES = \
librsvg-enum-types.h \
$(NULL)
+RUST_LIB = rust/target/debug/librsvg_internals.so
+
+.PHONY: rust/target/debug/librsvg_internals.so
+rust/target/release/librsvg_internals.so:
+ cd rust && \
+ cargo build --verbose
+
librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
@@ -95,6 +102,7 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_LDFLAGS = \
librsvg_@RSVG_API_MAJOR_VERSION@_la_LIBADD = \
$(LIBRSVG_LIBS) \
+ rust/target/release/librsvg_internals.so \
$(LIBM)
librsvgincdir = $(includedir)/librsvg-$(RSVG_API_VERSION)/librsvg
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 54d6779..3d427e5 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -8,3 +8,4 @@ cairo-rs = "^0"
[lib]
name = "rsvg_internals"
+crate-type = ["cdylib"]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]