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.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index f8529fb..90a6024 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -175,6 +175,21 @@ namespace build2
throw invalid_argument ("invalid preprocessed value '" + s + "'");
}
+ optional<path> compile_rule::
+ find_system_header (const path& f) const
+ {
+ path p; // Reuse the buffer.
+ for (const dir_path& d: sys_inc_dirs)
+ {
+ if (file_exists ((p = d, p /= f),
+ true /* follow_symlinks */,
+ true /* ignore_errors */))
+ return p;
+ }
+
+ return nullopt;
+ }
+
struct compile_rule::match_data
{
explicit