aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/compile-rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/compile-rule.cxx')
-rw-r--r--libbuild2/cc/compile-rule.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index 874674d..51d9b4d 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -4148,9 +4148,12 @@ namespace build2
nullptr, // CWD
env.empty () ? nullptr : env.data ());
- dbuf.open (args[0],
- move (pr.in_efd),
- fdstream_mode::non_blocking); // Skip on stdout.
+ if (cclass != compiler_class::msvc && gen)
+ {
+ dbuf.open (args[0],
+ move (pr.in_efd),
+ fdstream_mode::non_blocking); // Skip on stdout.
+ }
}
else // Dependency info goes to temporary file.
{
@@ -4169,8 +4172,11 @@ namespace build2
nullptr, // CWD
env.empty () ? nullptr : env.data ());
- dbuf.open (args[0], move (pr.in_efd));
- dbuf.read (sense_diag /* force */);
+ if (gen || sense_diag)
+ {
+ dbuf.open (args[0], move (pr.in_efd));
+ dbuf.read (sense_diag /* force */);
+ }
if (sense_diag)
{