]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: fix (again) out of tree builds
authorJason Ish <ish@unx.ca>
Mon, 15 Oct 2018 13:47:56 +0000 (07:47 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 15 Oct 2018 16:35:00 +0000 (18:35 +0200)
As the generated Cargo.toml is shipped as part of a release
tarball, build from the source directory but set the cargo
CARGO_TARGET_DIR to the build directory.

rust/Makefile.am

index 5a1814027f8e4e0779af16cf48164efa6d51681a..f73a10b7e36416cbd42f93fe1ab21c38a9f18ab3 100644 (file)
@@ -32,12 +32,12 @@ endif
 all-local:
 if HAVE_PYTHON
        cd $(top_srcdir)/rust && $(HAVE_PYTHON) ./gen-c-headers.py
-       CARGO_HOME=$(CARGO_HOME) $(CARGO) build $(RELEASE) $(FROZEN) \
-               --features "$(RUST_FEATURES)"
-else
-       CARGO_HOME=$(CARGO_HOME) $(CARGO) build $(RELEASE) $(FROZEN) \
-               --features "$(RUST_FEATURES)"
 endif
+       cd $(top_srcdir)/rust && \
+               CARGO_HOME=$(CARGO_HOME) \
+               CARGO_TARGET_DIR=$(abs_top_builddir)/rust/target \
+               $(CARGO) build $(RELEASE) $(FROZEN) \
+                       --features "$(RUST_FEATURES)"
 
 clean-local:
        -rm -rf target