aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2018-12-06 17:07:42 +0000
committerJan Beich <jbeich@FreeBSD.org>2018-12-06 17:07:42 +0000
commitaf90810038be0e383327d47886e4b69aa99b5d39 (patch)
treece52315c27daafa136e6b5cde7de2c1a26a7d4b2 /Mk
parent86f6bbfd8ea164cf5dc2405358430613041b3a59 (diff)
downloadports-af90810038be0e383327d47886e4b69aa99b5d39.tar.gz
ports-af90810038be0e383327d47886e4b69aa99b5d39.zip
USES=cargo to convert LDFLAGS into RUSTFLAGS
Approved by: rust (tobik) Differential Revision: https://reviews.freebsd.org/D18039
Notes
Notes: svn path=/head/; revision=486769
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/cargo.mk4
1 files changed, 1 insertions, 3 deletions
diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index cc608ef19cf9..a58c1853f8e2 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -62,15 +62,13 @@ CARGO_TARGET_DIR?= ${WRKDIR}/target
# - RUSTC: path of rustc binary (default to lang/rust)
# - RUSTDOC: path of rustdoc binary (default to lang/rust)
# - RUSTFLAGS: custom flags to pass to all compiler invocations that Cargo performs
-#
-# XXX LDFLAGS => -C link-arg=$1 (via RUSTFLAGS)
CARGO_ENV+= \
CARGO_HOME=${WRKDIR}/cargo-home \
CARGO_BUILD_JOBS=${MAKE_JOBS_NUMBER} \
CARGO_TARGET_DIR=${CARGO_TARGET_DIR} \
RUSTC=${LOCALBASE}/bin/rustc \
RUSTDOC=${LOCALBASE}/bin/rustdoc \
- RUSTFLAGS="${RUSTFLAGS}"
+ RUSTFLAGS="${RUSTFLAGS} ${LDFLAGS:S/^/-C link-arg=/}"
# Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk
.if ${ARCH} == amd64 || ${ARCH} == i386