]> git.lizzy.rs Git - rust.git/commitdiff
mk: Depend on regex_macros for tests appropriately
authorAlex Crichton <alex@alexcrichton.com>
Tue, 29 Apr 2014 15:55:40 +0000 (08:55 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 29 Apr 2014 15:55:40 +0000 (08:55 -0700)
There is currently not much precedent for target crates requiring syntax
extensions to compile their test versions. This dependency is possible, but
can't be encoded through the normal means of DEPS_regex because it is a
test-only dependency and it must be a *host* dependency (it's a syntax
extension).

Closes #13844

mk/tests.mk

index 9fc1c7390ccd044eb6f79a5083162e87f713175a..d97a3799bd060f10b78a5dbc1a25c86363f4f346 100644 (file)
@@ -349,6 +349,16 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
                            $$(foreach crate,$$(TARGET_CRATES),\
                                $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
                                $$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
+
+# The regex crate depends on the regex_macros crate during testing, but it
+# notably depend on the *host* regex_macros crate, not the target version.
+# Additionally, this is not a dependency in stage1, only in stage2.
+ifeq ($(4),regex)
+ifneq ($(1),1)
+TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
+endif
+endif
+
 else
 TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
 endif