aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-29 20:57:05 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2017-10-03 18:09:10 +0300
commit09839eea3a69e258555eb4ef6d05cd4799ccd7a0 (patch)
tree66fab0c85648740cca3ef282947e87bf95f8e183 /build2/cc/compile.cxx
parent0fe0b18432621713f96c437dfa3c81d4e3ae8e36 (diff)
Extract system header search paths from GCC or compatible
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r--build2/cc/compile.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx
index c1f4e08..639d3e2 100644
--- a/build2/cc/compile.cxx
+++ b/build2/cc/compile.cxx
@@ -760,8 +760,10 @@ namespace build2
// Extra system header dirs (last).
//
- for (const dir_path& d: sys_inc_dirs)
- cs.append (d.string ());
+ assert (sys_inc_dirs_extra <= sys_inc_dirs.size ());
+ for (auto i (sys_inc_dirs.begin () + sys_inc_dirs_extra);
+ i != sys_inc_dirs.end (); ++i)
+ cs.append (i->string ());
}
hash_options (cs, t, c_coptions);
@@ -1709,10 +1711,12 @@ namespace build2
// Extra system header dirs (last).
//
- for (const dir_path& d: sys_inc_dirs)
+ assert (sys_inc_dirs_extra <= sys_inc_dirs.size ());
+ for (auto i (sys_inc_dirs.begin () + sys_inc_dirs_extra);
+ i != sys_inc_dirs.end (); ++i)
{
args.push_back ("-I");
- args.push_back (d.string ().c_str ());
+ args.push_back (i->string ().c_str ());
}
if (md.symexport)
@@ -2670,10 +2674,12 @@ namespace build2
append_options (args, t, c_poptions);
append_options (args, t, x_poptions);
- for (const dir_path& d: sys_inc_dirs)
+ assert (sys_inc_dirs_extra <= sys_inc_dirs.size ());
+ for (auto i (sys_inc_dirs.begin () + sys_inc_dirs_extra);
+ i != sys_inc_dirs.end (); ++i)
{
args.push_back ("-I");
- args.push_back (d.string ().c_str ());
+ args.push_back (i->string ().c_str ());
}
if (md.symexport)
@@ -3879,10 +3885,12 @@ namespace build2
// Extra system header dirs (last).
//
- for (const dir_path& d: sys_inc_dirs)
+ assert (sys_inc_dirs_extra <= sys_inc_dirs.size ());
+ for (auto i (sys_inc_dirs.begin () + sys_inc_dirs_extra);
+ i != sys_inc_dirs.end (); ++i)
{
args.push_back ("-I");
- args.push_back (d.string ().c_str ());
+ args.push_back (i->string ().c_str ());
}
if (md.symexport)