Skip to content

Commit

Permalink
lang/rust: add LTO option
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubaj committed Jul 16, 2023
1 parent 8926cc5 commit bf0af79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lang/rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf0af79

Please sign in to comment.