aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-25 08:18:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-25 08:18:06 +0200
commitf8408539216cc213fa780560b7396af8ba801e2e (patch)
tree0505b46fc4a553631d10eda5861d233fee94d7b9 /libbuild2
parent0ea11771d82f47bcef891544b76c81f94838a30d (diff)
Fix diag buffer opining logic in cc::compile_rule
Diffstat (limited to 'libbuild2')
-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)
{