зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1437627 - part 2 - move incremental compilation logic to moz.configure; r=chmanchester
Doing checks in Python is much simpler than doing them in Makefile logic, and we're going to be adding some more complex logic in the next patch.
This commit is contained in:
Родитель
bf3af464e4
Коммит
dfc23d3001
|
@ -1463,6 +1463,26 @@ def rust_compiler_flags(opt_level, debug_rust, debug_symbols):
|
|||
|
||||
set_config('MOZ_RUST_DEFAULT_FLAGS', rust_compiler_flags)
|
||||
|
||||
# Rust incremental compilation
|
||||
# ==============================================================
|
||||
|
||||
|
||||
@depends('MOZ_AUTOMATION')
|
||||
def cargo_incremental(automation):
|
||||
"""Return a value for the CARGO_INCREMENTAL environment variable."""
|
||||
|
||||
# We never want to use incremental compilation in automation. sccache
|
||||
# handles our automation use case much better than incremental compilation
|
||||
# would.
|
||||
if automation:
|
||||
return '0'
|
||||
|
||||
# Don't do anything special in other situations.
|
||||
return
|
||||
|
||||
|
||||
set_config('CARGO_INCREMENTAL', cargo_incremental)
|
||||
|
||||
# Linker detection
|
||||
# ==============================================================
|
||||
|
||||
|
|
|
@ -864,10 +864,8 @@ cargo_rustc_flags += -C lto
|
|||
endif
|
||||
endif
|
||||
|
||||
# Disable incremental Rust compilation in automation builds, where
|
||||
# the lack of environmental continuity makes it unhelpful.
|
||||
ifdef MOZ_AUTOMATION
|
||||
cargo_incremental := CARGO_INCREMENTAL=0
|
||||
ifdef CARGO_INCREMENTAL
|
||||
cargo_incremental := CARGO_INCREMENTAL=$(CARGO_INCREMENTAL)
|
||||
endif
|
||||
|
||||
rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)'
|
||||
|
|
Загрузка…
Ссылка в новой задаче