@@ -27,6 +27,8 @@ pub struct TargetConfig {
27
27
pub runner : OptValue < PathAndArgs > ,
28
28
/// Additional rustc flags to pass.
29
29
pub rustflags : OptValue < StringList > ,
30
+ /// Additional rustdoc flags to pass.
31
+ pub rustdocflags : OptValue < StringList > ,
30
32
/// The path of the linker for this target.
31
33
pub linker : OptValue < ConfigRelativePath > ,
32
34
/// Build script override for the given library name.
@@ -98,6 +100,7 @@ pub(super) fn load_host_triple(gctx: &GlobalContext, triple: &str) -> CargoResul
98
100
Ok ( TargetConfig {
99
101
runner : None ,
100
102
rustflags : None ,
103
+ rustdocflags : None ,
101
104
linker : None ,
102
105
links_overrides : BTreeMap :: new ( ) ,
103
106
} )
@@ -118,6 +121,7 @@ fn load_config_table(gctx: &GlobalContext, prefix: &str) -> CargoResult<TargetCo
118
121
// environment variables would not work.
119
122
let runner: OptValue < PathAndArgs > = gctx. get ( & format ! ( "{}.runner" , prefix) ) ?;
120
123
let rustflags: OptValue < StringList > = gctx. get ( & format ! ( "{}.rustflags" , prefix) ) ?;
124
+ let rustdocflags: OptValue < StringList > = gctx. get ( & format ! ( "{}.rustdocflags" , prefix) ) ?;
121
125
let linker: OptValue < ConfigRelativePath > = gctx. get ( & format ! ( "{}.linker" , prefix) ) ?;
122
126
// Links do not support environment variables.
123
127
let target_key = ConfigKey :: from_str ( prefix) ;
@@ -128,6 +132,7 @@ fn load_config_table(gctx: &GlobalContext, prefix: &str) -> CargoResult<TargetCo
128
132
Ok ( TargetConfig {
129
133
runner,
130
134
rustflags,
135
+ rustdocflags,
131
136
linker,
132
137
links_overrides,
133
138
} )
@@ -144,7 +149,7 @@ fn parse_links_overrides(
144
149
// Skip these keys, it shares the namespace with `TargetConfig`.
145
150
match lib_name. as_str ( ) {
146
151
// `ar` is a historical thing.
147
- "ar" | "linker" | "runner" | "rustflags" => continue ,
152
+ "ar" | "linker" | "runner" | "rustflags" | "rustdocflags" => continue ,
148
153
_ => { }
149
154
}
150
155
let mut output = BuildOutput :: default ( ) ;
0 commit comments