@@ -641,6 +641,27 @@ cargo +nightly -Zunstable-options -Zconfig-include --config somefile.toml build
641
641
642
642
CLI paths are relative to the current working directory.
643
643
644
+ ### target-applies-to-host
645
+ * Original Pull Request: [ #9322 ] ( https://github.com/rust-lang/cargo/pull/9322 )
646
+
647
+ The ` target-applies-to-host ` key in a config file can be used set the desired
648
+ behavior for passing target config flags to build scripts.
649
+
650
+ It requires the ` -Ztarget-applies-to-host ` command-line option.
651
+
652
+ The current default for ` target-applies-to-host ` is ` true ` , which will be
653
+ changed to ` false ` in the future, if ` -Zhost-config ` is used the new ` false `
654
+ default will be set for ` target-applies-to-host ` .
655
+
656
+ ``` toml
657
+ # config.toml
658
+ target-applies-to-host = false
659
+ ```
660
+
661
+ ``` console
662
+ cargo +nightly -Ztarget-applies-to-host build --target x86_64-unknown-linux-gnu
663
+ ```
664
+
644
665
### host-config
645
666
* Original Pull Request: [ #9322 ] ( https://github.com/rust-lang/cargo/pull/9322 )
646
667
* Tracking Issue: [ #3349 ] ( https://github.com/rust-lang/cargo/issues/3349 )
@@ -650,12 +671,11 @@ such as build scripts that must run on the host system instead of the target
650
671
system when cross compiling. It supports both generic and host arch specific
651
672
tables. Matching host arch tables take precedence over generic host tables.
652
673
653
- It requires the ` -Zhost-config ` command-line option.
674
+ It requires the ` -Zhost-config ` and ` -Ztarget-applies-to-host ` command-line
675
+ options to be set.
654
676
655
677
``` toml
656
- # .cargo/config
657
- cargo-features = [" host-config" ]
658
-
678
+ # config.toml
659
679
[host ]
660
680
linker = " /path/to/host/linker"
661
681
[host .x86_64-unknown-linux-gnu ]
@@ -668,10 +688,11 @@ The generic `host` table above will be entirely ignored when building on a
668
688
` x86_64-unknown-linux-gnu ` host as the ` host.x86_64-unknown-linux-gnu ` table
669
689
takes precedence.
670
690
671
- This feature requires a ` --target ` to be specified.
691
+ Setting ` -Zhost-config ` changes the default for ` target-applies-to-host ` to
692
+ ` false ` from ` true ` .
672
693
673
694
``` console
674
- cargo +nightly -Zunstable-options -Zhost-config - -config somefile.toml build --target x86_64-unknown-linux-gnu
695
+ cargo +nightly -Ztarget-applies-to-host -Zhost -config build --target x86_64-unknown-linux-gnu
675
696
```
676
697
677
698
### unit-graph
0 commit comments