Bug 1541068 - add Rust compilation directories to GARBAGE_DIRS; r=nalexander

We add to `GARBAGE_DIRS` in the toplevel `Makefile.in` because all of
our Rust libraries share a single `CARGO_TARGET_DIR`, located in
topobjdir.

We add to `GARBAGE_DIRS` for Rust programs because Rust programs
currently do not share compilation artifacts with Rust libraries (as our
libraries are built with `panic=abort` and our programs are not, sharing
compilation artifacts between the two is a non-starter).

Differential Revision: https://phabricator.services.mozilla.com/D26762

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-04-09 18:59:19 +00:00
Родитель 654fc0c672
Коммит a780e0f5a1
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -24,6 +24,13 @@ endif
include $(topsrcdir)/config/config.mk
GARBAGE_DIRS += _javagen _profile staticlib
# To share compilation of dependencies, Rust libraries all set their
# CARGO_TARGET_DIR as a subdirectory of topobjdir. Normally, we would add
# RUST*TARGET to GARBAGE_DIRS for those directories building Rust libraries.
# But the directories building Rust libraries don't actually have
# subdirectories to remove. So we add to GARBAGE_DIRS once here, globally,
# for it to have the desired effect.
GARBAGE_DIRS += $(RUST_TARGET)
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
config/autoconf.mk \
mozilla-config.h \

Просмотреть файл

@ -290,6 +290,9 @@ force-cargo-host-library-check:
endif # HOST_RUST_LIBRARY_FILE
ifdef RUST_PROGRAMS
GARBAGE_DIRS += $(RUST_TARGET)
force-cargo-program-build:
$(REPORT_BUILD)
$(call CARGO_BUILD) $(addprefix --bin ,$(RUST_CARGO_PROGRAMS)) $(cargo_target_flag)
@ -303,6 +306,9 @@ force-cargo-program-check:
@true
endif # RUST_PROGRAMS
ifdef HOST_RUST_PROGRAMS
GARBAGE_DIRS += $(RUST_HOST_TARGET)
force-cargo-host-program-build:
$(REPORT_BUILD)
$(call CARGO_BUILD) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)