Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

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 drahnr committed Apr 6, 2021
1 parent c2ab20d commit 063ab2f
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 063ab2f

Please sign in to comment.