tamer: configure.ac: Configure-time feature flags (via Cargo)

main
Mike Gerwitz 2021-07-23 10:16:44 -04:00
parent 5aaa1106cb
commit f1a3273ee3
2 changed files with 11 additions and 3 deletions

View File

@ -25,7 +25,7 @@
CARGO_BUILD_FLAGS=@CARGO_BUILD_FLAGS@
all:
@CARGO@ build $(CARGO_BUILD_FLAGS)
@CARGO@ build $(CARGO_BUILD_FLAGS) @FEATURES@
doc: html
html-am:
@ -35,13 +35,13 @@ html-am:
# note that 'cargo check' is something else; see 'cargo --help'
test: check
check-am: check-fmt
@CARGO@ test
@CARGO@ test @FEATURES@
check-fmt:
@CARGO@ fmt -- --check
bench:
@CARGO@ @CARGO_BENCH_FLAGS@ bench
@CARGO@ @CARGO_BENCH_FLAGS@ bench @FEATURES@
fix: fmt
fmt:

View File

@ -92,6 +92,14 @@ AS_IF([cargo $CARGO_DOC_FLAGS doc --help &>/dev/null],
AC_MSG_WARN([missing cargo-doc for toolchain])
AC_MSG_WARN([`make html` will not work])])
AC_ARG_VAR([FEATURES],
[Cargo features flags for TAMER, comma-delimited])
test -z "$FEATURES" || {
AC_MSG_RESULT([requested features: $FEATURES])
FEATURES="--features $FEATURES"
}
AC_CONFIG_FILES([Makefile])
AC_OUTPUT