Skip to content

Commit edba858

Browse files
committed
If env-var is set, don't build all targets
1 parent 0e9246c commit edba858

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/docbuilder/rustwide_builder.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,18 @@ impl RustwideBuilder {
342342
)?;
343343

344344
successful_targets.push(res.target.clone());
345+
346+
// this is a breaking change, don't enable it by default
347+
let build_specific = std::env::var("DOCS_RS_BUILD_ONLY_SPECIFIED_TARGETS")
348+
.map(|s| s == "true").unwrap_or(false);
349+
let strs: Vec<_>;
350+
let targets: &[&str] = if build_specific {
351+
strs = metadata.extra_targets.iter().map(|s| s.as_str()).collect();
352+
&strs
353+
} else { TARGETS };
354+
345355
// Then build the documentation for all the targets
346-
for target in TARGETS {
356+
for target in targets {
347357
if *target == res.target {
348358
continue;
349359
}

0 commit comments

Comments
 (0)