Skip to content

Commit

Permalink
Pass -clang:-frewrite-includes to clang-cl.
Browse files Browse the repository at this point in the history
Fixes #894.
  • Loading branch information
mstange authored and glandium committed Dec 11, 2020
1 parent 1ae5d3c commit 422ef65
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 @@ -694,6 +696,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 Down Expand Up @@ -723,6 +727,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 422ef65

Please sign in to comment.