git: bf0af791ab80 - main - lang/rust: add LTO option
Date: Sun, 16 Jul 2023 10:59:00 UTC
The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=bf0af791ab80f4f109bfecf4a954bcf94f00947d commit bf0af791ab80f4f109bfecf4a954bcf94f00947d Author: Piotr Kubaj <pkubaj@FreeBSD.org> AuthorDate: 2023-07-16 10:57:56 +0000 Commit: Piotr Kubaj <pkubaj@FreeBSD.org> CommitDate: 2023-07-16 10:58:20 +0000 lang/rust: add LTO option --- lang/rust/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 184c0768b95f..71d8416d34b8 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -48,7 +48,7 @@ CONFLICTS_INSTALL?= rust-nightly # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} -OPTIONS_DEFINE= DOCS GDB SOURCES WASM +OPTIONS_DEFINE= DOCS GDB LTO SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM GDB_DESC= Install ports gdb (necessary for debugging rust programs) @@ -191,7 +191,13 @@ do-configure: @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml +.if ${PORT_OPTIONS:MLTO} + @${ECHO_CMD} 'lto="thin"' >> ${WRKSRC}/config.toml +.endif @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml +.if ${PORT_OPTIONS:MLTO} + @${ECHO_CMD} 'thin-lto=true' >> ${WRKSRC}/config.toml +.endif .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else