Skip to content

Commit

Permalink
Pass -clang:-frewrite-includes to clang-cl.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Dec 3, 2020
1 parent 6628e1f commit 72d40c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/compiler/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl CCompilerImpl for MSVC {
cwd: &Path,
env_vars: &[(OsString, OsString)],
may_dist: bool,
_rewrite_includes_only: bool,
rewrite_includes_only: bool,
) -> SFuture<process::Output>
where
T: CommandCreatorSync,
Expand All @@ -79,6 +79,8 @@ impl CCompilerImpl for MSVC {
env_vars,
may_dist,
&self.includes_prefix,
rewrite_includes_only,
self.is_clang,
)
}

Expand Down Expand Up @@ -692,6 +694,8 @@ pub fn preprocess<T>(
env_vars: &[(OsString, OsString)],
_may_dist: bool,
includes_prefix: &str,
rewrite_includes_only: bool,
is_clang: bool,
) -> SFuture<process::Output>
where
T: CommandCreatorSync,
Expand All @@ -709,6 +713,9 @@ where
if parsed_args.depfile.is_some() || parsed_args.msvc_show_includes {
cmd.arg("-showIncludes");
}
if rewrite_includes_only && is_clang {
cmd.arg("-clang:-frewrite-includes");
}

if log_enabled!(Debug) {
debug!("preprocess: {:?}", cmd);
Expand Down

0 comments on commit 72d40c8

Please sign in to comment.