diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-20 18:49:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-11-20 18:49:54 +0200 |
commit | 64935e99b7f22fb761b90b9e57b6aab3c348830f (patch) | |
tree | 7402ad1d3c5bb1e39cb312e6b5ee5a228b627466 | |
parent | d57d929b5a927bdd1d6f2ee9e2887892148fdbb0 (diff) |
Handle case when compiler-reported header does not exist
This, for example, happens when compiling under wine with file wlantypes.h
included as WlanTypes.h.
-rw-r--r-- | build2/cc/compile.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 49ff453..6022fb6 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -2172,7 +2172,22 @@ namespace build2 // if (!cache) { - f.realize (); + // While we can reasonably expect this path to exit, things do + // go south from time to time (like compiling under wine with + // file wlantypes.h included as WlanTypes.h). + // + try + { + f.realize (); + } + catch (const invalid_path&) + { + fail << "invalid header path '" << f << "'"; + } + catch (const system_error& e) + { + fail << "invalid header path '" << f << "': " << e; + } if (!so_map.empty ()) { |