Skip to content

Commit

Permalink
fixup! makefiles: Add mechanism to build modules through Cargo
Browse files Browse the repository at this point in the history
Code duplicated during editing
  • Loading branch information
chrysn committed Apr 3, 2021
1 parent 671d8c3 commit 8b00fb3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions makefiles/cargo-targets.inc.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Flags that need to be added to the RIOT_CFLAGS passed to cargo in order to
# make bindgen happy
CARGO_EXTRACFLAGS ?=

# Setting anything other than debug or release will necessitate additional -Z
# unstable-options as of 2021-03 nightlies.
CARGO_PROFILE ?= debug
# As long as C2Rust and riot-wrappers require nightly, the only alternative
# here is to pick a particular nightly when something breaks.
CARGO_CHANNEL ?= nightly

CARGO_LIB = target/$(CARGO_TARGET)/${CARGO_PROFILE}/lib$(APPLICATION_RUST_MODULE).a

$(CARGO_LIB): $(RIOTBUILD_CONFIG_HEADER_C) $(BUILDDEPS) FORCE
$(Q)[ x"${CARGO_TARGET}" != x"" ] || (echo "Error: No CARGO_TARGET was set for this platform"; exit 1)
$(Q)CC= CFLAGS= CPPFLAGS= CXXFLAGS= RIOT_CC="${CC}" RIOT_CFLAGS="$(CFLAGS_WITH_MACROS) $(INCLUDES) $(CARGO_EXTRACFLAGS)" cargo +$(CARGO_CHANNEL) build --target $(CARGO_TARGET) `if [ x$(CARGO_PROFILE) = xrelease ]; then echo --release; else if [ x$(CARGO_PROFILE) '!=' xdebug ]; then echo "--profile $(CARGO_PROFILE)"; fi; fi` $(CARGO_OPTIONS)
Expand Down

0 comments on commit 8b00fb3

Please sign in to comment.