From 3df81f14a044ca615157978272349e0d200c3bd4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 May 2021 15:56:30 +0200 Subject: Rename sys_inc_dirs to sys_hdr_dirs for consistency --- libbuild2/c/init.cxx | 8 ++++---- libbuild2/cc/common.hxx | 20 ++++++++++---------- libbuild2/cc/compile-rule.cxx | 26 ++++++++++++------------- libbuild2/cc/compile-rule.hxx | 2 +- libbuild2/cc/guess.cxx | 16 ++++++++-------- libbuild2/cc/guess.hxx | 4 ++-- libbuild2/cc/module.cxx | 44 +++++++++++++++++++++---------------------- libbuild2/cc/module.hxx | 4 ++-- libbuild2/cc/pkgconfig.cxx | 10 +++++----- libbuild2/cc/types.cxx | 8 ++++---- libbuild2/cc/types.hxx | 6 +++--- libbuild2/cxx/init.cxx | 8 ++++---- 12 files changed, 78 insertions(+), 78 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/c/init.cxx b/libbuild2/c/init.cxx index 1849622..1813da3 100644 --- a/libbuild2/c/init.cxx +++ b/libbuild2/c/init.cxx @@ -182,7 +182,7 @@ namespace build2 vp.insert ("c.config.path"), vp.insert ("c.config.mode"), vp.insert ("c.sys_lib_dirs"), - vp.insert ("c.sys_inc_dirs"), + vp.insert ("c.sys_hdr_dirs"), vp.insert ("c.std"), @@ -349,15 +349,15 @@ namespace build2 false, // No __symexport support since no modules. cast (rs[cm.x_sys_lib_dirs]), - cast (rs[cm.x_sys_inc_dirs]), + cast (rs[cm.x_sys_hdr_dirs]), cm.x_info->sys_mod_dirs ? &cm.x_info->sys_mod_dirs->first : nullptr, cm.sys_lib_dirs_mode, - cm.sys_inc_dirs_mode, + cm.sys_hdr_dirs_mode, cm.sys_mod_dirs_mode, cm.sys_lib_dirs_extra, - cm.sys_inc_dirs_extra, + cm.sys_hdr_dirs_extra, c::static_type, nullptr, // No C modules yet. diff --git a/libbuild2/cc/common.hxx b/libbuild2/cc/common.hxx index 747395b..176c30e 100644 --- a/libbuild2/cc/common.hxx +++ b/libbuild2/cc/common.hxx @@ -71,7 +71,7 @@ namespace build2 const variable& x_c_path; // Compiler path as configured. const variable& x_c_mode; // Compiler mode as configured. const variable& x_sys_lib_dirs; // System library search directories. - const variable& x_sys_inc_dirs; // System header search directories. + const variable& x_sys_hdr_dirs; // System header search directories. const variable& x_std; const variable& x_poptions; @@ -182,15 +182,15 @@ namespace build2 // (e.g., fallback directories such as /usr/local/*). // const dir_paths& sys_lib_dirs; // x.sys_lib_dirs - const dir_paths& sys_inc_dirs; // x.sys_inc_dirs + const dir_paths& sys_hdr_dirs; // x.sys_hdr_dirs const dir_paths* sys_mod_dirs; // compiler_info::sys_mod_dirs size_t sys_lib_dirs_mode; // Number of leading mode entries (0 if none). - size_t sys_inc_dirs_mode; + size_t sys_hdr_dirs_mode; size_t sys_mod_dirs_mode; size_t sys_lib_dirs_extra; // First trailing extra entry (size if none). - size_t sys_inc_dirs_extra; + size_t sys_hdr_dirs_extra; const target_type& x_src; // Source target type (c{}, cxx{}). const target_type* x_mod; // Module target type (mxx{}), if any. @@ -236,10 +236,10 @@ namespace build2 bool fm, bool fs, const dir_paths& sld, - const dir_paths& sid, + const dir_paths& shd, const dir_paths* smd, - size_t slm, size_t sim, size_t smm, - size_t sle, size_t sie, + size_t slm, size_t shm, size_t smm, + size_t sle, size_t she, const target_type& src, const target_type* mod, const target_type* const* hdr, @@ -257,10 +257,10 @@ namespace build2 modules (fm), symexport (fs), importable_headers (nullptr), - sys_lib_dirs (sld), sys_inc_dirs (sid), sys_mod_dirs (smd), - sys_lib_dirs_mode (slm), sys_inc_dirs_mode (sim), + sys_lib_dirs (sld), sys_hdr_dirs (shd), sys_mod_dirs (smd), + sys_lib_dirs_mode (slm), sys_hdr_dirs_mode (shm), sys_mod_dirs_mode (smm), - sys_lib_dirs_extra (sle), sys_inc_dirs_extra (sie), + sys_lib_dirs_extra (sle), sys_hdr_dirs_extra (she), x_src (src), x_mod (mod), x_hdr (hdr), x_inc (inc) {} }; diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 90a6024..0f4ece3 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -179,7 +179,7 @@ namespace build2 find_system_header (const path& f) const { path p; // Reuse the buffer. - for (const dir_path& d: sys_inc_dirs) + for (const dir_path& d: sys_hdr_dirs) { if (file_exists ((p = d, p /= f), true /* follow_symlinks */, @@ -220,15 +220,15 @@ namespace build2 template void compile_rule:: - append_sys_inc_options (T& args) const + append_sys_hdr_options (T& args) const { - assert (sys_inc_dirs_extra <= sys_inc_dirs.size ()); + assert (sys_hdr_dirs_extra <= sys_hdr_dirs.size ()); // Note that the mode options are added as part of cmode. // - auto b (sys_inc_dirs.begin () + sys_inc_dirs_mode); - auto m (sys_inc_dirs.begin () + sys_inc_dirs_extra); - auto e (sys_inc_dirs.end ()); + auto b (sys_hdr_dirs.begin () + sys_hdr_dirs_mode); + auto m (sys_hdr_dirs.begin () + sys_hdr_dirs_extra); + auto e (sys_hdr_dirs.end ()); // Note: starting from 15.6, MSVC gained /external:I option though it // doesn't seem to affect the order, only "system-ness". @@ -1013,7 +1013,7 @@ namespace build2 append_options (cs, cmode); if (md.pp != preprocessed::all) - append_sys_inc_options (cs); // Extra system header dirs (last). + append_sys_hdr_options (cs); // Extra system header dirs (last). if (dd.expect (cs.string ()) != nullptr) l4 ([&]{trace << "options mismatch forcing update of " << t;}); @@ -3609,7 +3609,7 @@ namespace build2 args.push_back ("/nologo"); append_options (args, cmode); - append_sys_inc_options (args); // Extra system header dirs (last). + append_sys_hdr_options (args); // Extra system header dirs (last). // See perform_update() for details on overriding the default // exceptions and runtime. @@ -3679,7 +3679,7 @@ namespace build2 append_options (args, cmode, cmode.size () - (modules && clang ? 1 : 0)); - append_sys_inc_options (args); // Extra system header dirs (last). + append_sys_hdr_options (args); // Extra system header dirs (last). // Setup the dynamic module mapper if needed. // @@ -4903,7 +4903,7 @@ namespace build2 args.push_back ("/nologo"); append_options (args, cmode); - append_sys_inc_options (args); + append_sys_hdr_options (args); if (x_lang == lang::cxx && !find_option_prefix ("/EH", args)) args.push_back ("/EHsc"); @@ -4952,7 +4952,7 @@ namespace build2 append_options (args, cmode, cmode.size () - (modules && clang ? 1 : 0)); - append_sys_inc_options (args); + append_sys_hdr_options (args); args.push_back ("-E"); append_lang_options (args, md); @@ -6785,7 +6785,7 @@ namespace build2 append_options (args, cmode); if (md.pp != preprocessed::all) - append_sys_inc_options (args); // Extra system header dirs (last). + append_sys_hdr_options (args); // Extra system header dirs (last). // While we want to keep the low-level build as "pure" as possible, // the two misguided defaults, C++ exceptions and runtime, just have @@ -6996,7 +6996,7 @@ namespace build2 append_options (args, cmode); if (md.pp != preprocessed::all) - append_sys_inc_options (args); // Extra system header dirs (last). + append_sys_hdr_options (args); // Extra system header dirs (last). append_header_options (env, args, header_args, a, t, md, md.dd); append_module_options (env, args, module_args, a, t, md, md.dd); diff --git a/libbuild2/cc/compile-rule.hxx b/libbuild2/cc/compile-rule.hxx index e80c36a..e4347f8 100644 --- a/libbuild2/cc/compile-rule.hxx +++ b/libbuild2/cc/compile-rule.hxx @@ -74,7 +74,7 @@ namespace build2 template void - append_sys_inc_options (T&) const; + append_sys_hdr_options (T&) const; template void diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index b45a413..64139bf 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -1473,7 +1473,7 @@ namespace build2 // do that probably first checking if they exist/empty). // static pair - msvc_inc (const msvc_info& mi, const strings& mo) + msvc_hdr (const msvc_info& mi, const strings& mo) { dir_paths r; @@ -1754,7 +1754,7 @@ namespace build2 // supply PATH/INCLUDE/LIB/IFCPATH equivalents ourselves. // optional> lib_dirs; - optional> inc_dirs; + optional> hdr_dirs; optional> mod_dirs; string bpat; @@ -1763,7 +1763,7 @@ namespace build2 const char* cpu (msvc_cpu (target_triplet (t).cpu)); lib_dirs = msvc_lib (*mi, x_mo, cpu); - inc_dirs = msvc_inc (*mi, x_mo); + hdr_dirs = msvc_hdr (*mi, x_mo); mod_dirs = msvc_mod (*mi, x_mo, cpu); bpat = msvc_bin (*mi, cpu); @@ -1807,7 +1807,7 @@ namespace build2 move (csl), move (xsl), move (lib_dirs), - move (inc_dirs), + move (hdr_dirs), move (mod_dirs), msvc_env, nullptr}; @@ -3458,7 +3458,7 @@ namespace build2 void guess_std_importable_headers (const compiler_info& ci, - const dir_paths& sys_inc_dirs, + const dir_paths& sys_hdr_dirs, importable_headers& hs) { hs.group_map.emplace (header_group_std, 0); @@ -3486,16 +3486,16 @@ namespace build2 if (ci.id.type != compiler_type::gcc) { for (const char* f: std_importable) - if ((p = hs.insert_angle (sys_inc_dirs, f)) != nullptr) + if ((p = hs.insert_angle (sys_hdr_dirs, f)) != nullptr) add_groups (true); for (const char* f: std_non_importable) - if ((p = hs.insert_angle (sys_inc_dirs, f)) != nullptr) + if ((p = hs.insert_angle (sys_hdr_dirs, f)) != nullptr) add_groups (false); } else { - p = hs.insert_angle (sys_inc_dirs, std_importable[0]); + p = hs.insert_angle (sys_hdr_dirs, std_importable[0]); assert (p != nullptr); add_groups (true); diff --git a/libbuild2/cc/guess.hxx b/libbuild2/cc/guess.hxx index 0180c97..53acc15 100644 --- a/libbuild2/cc/guess.hxx +++ b/libbuild2/cc/guess.hxx @@ -237,7 +237,7 @@ namespace build2 // entries, if extracted at the guess stage. // optional> sys_lib_dirs; - optional> sys_inc_dirs; + optional> sys_hdr_dirs; optional> sys_mod_dirs; // Optional list of environment variables that affect the compiler and @@ -283,7 +283,7 @@ namespace build2 // void guess_std_importable_headers (const compiler_info&, - const dir_paths& sys_inc_dirs, + const dir_paths& sys_hdr_dirs, importable_headers&); } } diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index 44f1943..959d315 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -359,7 +359,7 @@ namespace build2 struct search_dirs { pair lib; - pair inc; + pair hdr; }; static global_cache dirs_cache; @@ -464,13 +464,13 @@ namespace build2 // Note that for now module search paths only come from compiler_info. // pair lib_dirs; - pair inc_dirs; + pair hdr_dirs; const optional>& mod_dirs (xi.sys_mod_dirs); - if (xi.sys_lib_dirs && xi.sys_inc_dirs) + if (xi.sys_lib_dirs && xi.sys_hdr_dirs) { lib_dirs = *xi.sys_lib_dirs; - inc_dirs = *xi.sys_inc_dirs; + hdr_dirs = *xi.sys_hdr_dirs; } else { @@ -505,19 +505,19 @@ namespace build2 } } - if (xi.sys_inc_dirs) - inc_dirs = *xi.sys_inc_dirs; + if (xi.sys_hdr_dirs) + hdr_dirs = *xi.sys_hdr_dirs; else if (sd != nullptr) - inc_dirs = sd->inc; + hdr_dirs = sd->hdr; else { switch (xi.class_) { case compiler_class::gcc: - inc_dirs = gcc_header_search_dirs (xi.path, rs); + hdr_dirs = gcc_header_search_dirs (xi.path, rs); break; case compiler_class::msvc: - inc_dirs = msvc_header_search_dirs (xi.path, rs); + hdr_dirs = msvc_header_search_dirs (xi.path, rs); break; } } @@ -526,17 +526,17 @@ namespace build2 { search_dirs sd; if (!xi.sys_lib_dirs) sd.lib = lib_dirs; - if (!xi.sys_inc_dirs) sd.inc = inc_dirs; + if (!xi.sys_hdr_dirs) sd.hdr = hdr_dirs; dirs_cache.insert (move (key), move (sd)); } } sys_lib_dirs_mode = lib_dirs.second; - sys_inc_dirs_mode = inc_dirs.second; + sys_hdr_dirs_mode = hdr_dirs.second; sys_mod_dirs_mode = mod_dirs ? mod_dirs->second : 0; sys_lib_dirs_extra = lib_dirs.first.size (); - sys_inc_dirs_extra = inc_dirs.first.size (); + sys_hdr_dirs_extra = hdr_dirs.first.size (); #ifndef _WIN32 // Add /usr/local/{include,lib}. We definitely shouldn't do this if we @@ -552,7 +552,7 @@ namespace build2 // on the next invocation. // { - auto& is (inc_dirs.first); + auto& is (hdr_dirs.first); auto& ls (lib_dirs.first); bool ui (find (is.begin (), is.end (), usr_inc) != is.end ()); @@ -683,7 +683,7 @@ namespace build2 } auto& mods (mod_dirs ? mod_dirs->first : dir_paths ()); - auto& incs (inc_dirs.first); + auto& incs (hdr_dirs.first); auto& libs (lib_dirs.first); if (verb >= 3 && !mods.empty ()) @@ -697,10 +697,10 @@ namespace build2 if (verb >= 3 && !incs.empty ()) { - dr << "\n inc dirs"; + dr << "\n hdr dirs"; for (size_t i (0); i != incs.size (); ++i) { - if (i == sys_inc_dirs_extra) + if (i == sys_hdr_dirs_extra) dr << "\n --"; dr << "\n " << incs[i]; } @@ -719,7 +719,7 @@ namespace build2 } rs.assign (x_sys_lib_dirs) = move (lib_dirs.first); - rs.assign (x_sys_inc_dirs) = move (inc_dirs.first); + rs.assign (x_sys_hdr_dirs) = move (hdr_dirs.first); config::save_environment (rs, xi.compiler_environment); config::save_environment (rs, xi.platform_environment); @@ -740,7 +740,7 @@ namespace build2 // Global cache of ad hoc importable headers. // // The key is a hash of the system header search directories - // (sys_inc_dirs) where we search for the headers. + // (sys_hdr_dirs) where we search for the headers. // static map importable_headers_cache; static mutex importable_headers_mutex; @@ -776,7 +776,7 @@ namespace build2 { { sha256 k; - for (const dir_path& d: sys_inc_dirs) + for (const dir_path& d: sys_hdr_dirs) k.append (d.string ()); mlock l (importable_headers_mutex); @@ -788,7 +788,7 @@ namespace build2 ulock ul (hs.mutex); if (hs.group_map.find (header_group_std) == hs.group_map.end ()) - guess_std_importable_headers (xi, sys_inc_dirs, hs); + guess_std_importable_headers (xi, sys_hdr_dirs, hs); // Process x.translate_include. // @@ -803,7 +803,7 @@ namespace build2 { if (path_pattern (k)) { - size_t n (hs.insert_angle_pattern (sys_inc_dirs, k)); + size_t n (hs.insert_angle_pattern (sys_hdr_dirs, k)); l5 ([&]{trace << "pattern " << k << " searched to " << n << " headers";}); @@ -816,7 +816,7 @@ namespace build2 // let's ignore (we could have also removed it from the map as // an indication). // - const auto* r (hs.insert_angle (sys_inc_dirs, k)); + const auto* r (hs.insert_angle (sys_hdr_dirs, k)); l5 ([&]{trace << "header " << k << " searched to " << (r ? r->first.string ().c_str () : "");}); diff --git a/libbuild2/cc/module.hxx b/libbuild2/cc/module.hxx index ed6ec41..e21fb9e 100644 --- a/libbuild2/cc/module.hxx +++ b/libbuild2/cc/module.hxx @@ -64,11 +64,11 @@ namespace build2 // Temporary storage for data::sys_*_dirs_*. // size_t sys_lib_dirs_mode; - size_t sys_inc_dirs_mode; + size_t sys_hdr_dirs_mode; size_t sys_mod_dirs_mode; size_t sys_lib_dirs_extra; - size_t sys_inc_dirs_extra; + size_t sys_hdr_dirs_extra; bool new_config = false; // See guess() and init() for details. diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx index fd88b59..4c2d55b 100644 --- a/libbuild2/cc/pkgconfig.cxx +++ b/libbuild2/cc/pkgconfig.cxx @@ -93,7 +93,7 @@ namespace build2 explicit pkgconf (path_type, const dir_paths& pc_dirs, - const dir_paths& sys_inc_dirs, + const dir_paths& sys_hdr_dirs, const dir_paths& sys_lib_dirs); // Create a special empty object. Querying package information on such @@ -299,7 +299,7 @@ namespace build2 pkgconf (path_type p, const dir_paths& pc_dirs, const dir_paths& sys_lib_dirs, - const dir_paths& sys_inc_dirs) + const dir_paths& sys_hdr_dirs) : path (move (p)) { auto add_dirs = [] (pkgconf_list_t& dir_list, @@ -339,7 +339,7 @@ namespace build2 true /* cleanup */); add_dirs (c->filter_includedirs, - sys_inc_dirs, + sys_hdr_dirs, false /* suppress_dups */, true /* cleanup */); @@ -1324,11 +1324,11 @@ namespace build2 bool pa (at != nullptr && !ap.empty ()); if (pa || sp.empty ()) - apc = pkgconf (ap, pc_dirs, sys_lib_dirs, sys_inc_dirs); + apc = pkgconf (ap, pc_dirs, sys_lib_dirs, sys_hdr_dirs); bool ps (st != nullptr && !sp.empty ()); if (ps || ap.empty ()) - spc = pkgconf (sp, pc_dirs, sys_lib_dirs, sys_inc_dirs); + spc = pkgconf (sp, pc_dirs, sys_lib_dirs, sys_hdr_dirs); // Sort out the interface dependencies (which we are setting on lib{}). // If we have the shared .pc variant, then we use that. Otherwise -- diff --git a/libbuild2/cc/types.cxx b/libbuild2/cc/types.cxx index bd68147..8ee4fa9 100644 --- a/libbuild2/cc/types.cxx +++ b/libbuild2/cc/types.cxx @@ -56,7 +56,7 @@ namespace build2 } auto importable_headers:: - insert_angle (const dir_paths& sys_inc_dirs, + insert_angle (const dir_paths& sys_hdr_dirs, const string& s) -> pair* { assert (s.front () == '<' && s.back () == '>'); @@ -69,7 +69,7 @@ namespace build2 path f (s, 1, s.size () - 2); path p; // Reuse the buffer. - for (const dir_path& d: sys_inc_dirs) + for (const dir_path& d: sys_hdr_dirs) { if (file_exists ((p = d, p /= f), true /* follow_symlinks */, @@ -121,7 +121,7 @@ namespace build2 } size_t importable_headers:: - insert_angle_pattern (const dir_paths& sys_inc_dirs, const string& pat) + insert_angle_pattern (const dir_paths& sys_hdr_dirs, const string& pat) { assert (pat.front () == '<' && pat.back () == '>' && path_pattern (pat)); @@ -166,7 +166,7 @@ namespace build2 return true; }; - for (const dir_path& dir: sys_inc_dirs) + for (const dir_path& dir: sys_hdr_dirs) { d.dir = &dir; diff --git a/libbuild2/cc/types.hxx b/libbuild2/cc/types.hxx index 1297b7b..c5b35f5 100644 --- a/libbuild2/cc/types.hxx +++ b/libbuild2/cc/types.hxx @@ -86,7 +86,7 @@ namespace build2 // Ad hoc (as opposed to marked with x.importable) importable headers. // // Note that these are only searched for in the system header search - // directories (sys_inc_dirs). + // directories (sys_hdr_dirs). // struct importable_headers { @@ -125,7 +125,7 @@ namespace build2 // found and NULL otherwise (so can be used as bool). // pair* - insert_angle (const dir_paths& sys_inc_dirs, const string& file); + insert_angle (const dir_paths& sys_hdr_dirs, const string& file); // As above but for a manually-searched absolute and normalized path. // @@ -139,7 +139,7 @@ namespace build2 // pattern. // size_t - insert_angle_pattern (const dir_paths& sys_inc_dirs, const string& pat); + insert_angle_pattern (const dir_paths& sys_hdr_dirs, const string& pat); }; // Headers and header groups whose inclusion should or should not be diff --git a/libbuild2/cxx/init.cxx b/libbuild2/cxx/init.cxx index 2c5c919..e517523 100644 --- a/libbuild2/cxx/init.cxx +++ b/libbuild2/cxx/init.cxx @@ -525,7 +525,7 @@ namespace build2 vp.insert ("cxx.config.path"), vp.insert ("cxx.config.mode"), vp.insert ("cxx.sys_lib_dirs"), - vp.insert ("cxx.sys_inc_dirs"), + vp.insert ("cxx.sys_hdr_dirs"), vp.insert ("cxx.std"), @@ -726,15 +726,15 @@ namespace build2 symexport, cast (rs[cm.x_sys_lib_dirs]), - cast (rs[cm.x_sys_inc_dirs]), + cast (rs[cm.x_sys_hdr_dirs]), cm.x_info->sys_mod_dirs ? &cm.x_info->sys_mod_dirs->first : nullptr, cm.sys_lib_dirs_mode, - cm.sys_inc_dirs_mode, + cm.sys_hdr_dirs_mode, cm.sys_mod_dirs_mode, cm.sys_lib_dirs_extra, - cm.sys_inc_dirs_extra, + cm.sys_hdr_dirs_extra, cxx::static_type, modules ? &mxx::static_type : nullptr, -- cgit v1.1