rust: --enable-rust-strict to turn warnings into errors

pull/2850/head
Jason Ish 8 years ago committed by Victor Julien
parent f715b0ae6b
commit 6a4cefb7c5

@ -2055,6 +2055,13 @@
fi
AM_CONDITIONAL([HAVE_CARGO_VENDOR], [test "x$HAVE_CARGO_VENDOR" != "xno"])
AC_ARG_ENABLE(rust_strict,
AS_HELP_STRING([--enable-rust-strict], [Rust warnings as errors]),,[enable_rust_strict=no])
AS_IF([test "x$enable_rust_strict" = "xyes"], [
RUST_FEATURES="strict"
])
AC_SUBST(RUST_FEATURES)
# get revision
if test -f ./revision; then
REVISION=`cat ./revision`
@ -2168,6 +2175,7 @@ SURICATA_BUILD_CONF="Suricata Configuration:
Rust support (experimental): ${enable_rust}
Experimental Rust parsers: ${enable_rust_experimental}
Rust strict mode: ${enable_rust_strict}
Suricatasc install: ${enable_python}

@ -11,6 +11,7 @@ debug = true
[features]
lua = []
experimental = ["ntp-parser"]
strict = []
[dependencies]
nom = "~3.0"

@ -19,14 +19,14 @@ if !DEBUG
RELEASE = --release
endif
FEATURES =
RUST_FEATURES =
if HAVE_LUA
FEATURES += lua
RUST_FEATURES += lua
endif
if HAVE_RUST_EXTERNAL
FEATURES += experimental
RUST_FEATURES += experimental
endif
all-local:
@ -35,11 +35,11 @@ if HAVE_PYTHON
$(HAVE_PYTHON) ./gen-c-headers.py && \
CARGO_TARGET_DIR=$(abs_builddir)/target \
CARGO_HOME=$(CARGO_HOME) $(CARGO) build $(RELEASE) $(FROZEN) \
--features "$(FEATURES)"
--features "$(RUST_FEATURES)"
else
cd $(top_srcdir)/rust && CARGO_TARGET_DIR=$(abs_builddir)/target \
CARGO_HOME=$(CARGO_HOME) $(CARGO) build $(RELEASE) $(FROZEN) \
--features "$(FEATURES)"
--features "$(RUST_FEATURES)"
endif
clean-local:

@ -15,6 +15,8 @@
* 02110-1301, USA.
*/
#![cfg_attr(feature = "strict", deny(warnings))]
extern crate libc;
#[macro_use]

Loading…
Cancel
Save