diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-11 14:44:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-30 16:56:08 +0200 |
commit | a14b9bc18431c6aed8441261d28b6ff20bd25935 (patch) | |
tree | ae1f07caef838b5b03fa3f82a2cfccbb62b24ed3 /build2/cxx/init.cxx | |
parent | ca0f9c71be279aee845bf5328ac0af8c02c8849e (diff) |
Initial take on header unit and include translation support
Diffstat (limited to 'build2/cxx/init.cxx')
-rw-r--r-- | build2/cxx/init.cxx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index aca1fb8..adb1d92 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -387,14 +387,26 @@ namespace build2 v.insert<strings> ("config.cxx.loptions", true), v.insert<strings> ("config.cxx.libs", true), + // List of modular headers. Inclusion of such headers is translated to + // the corresponding header unit imports. + // + // A header can be specified either as an absolute and normalized path + // or as a <>-style include name. The latter kind is automatically + // translated to the absolute form based on the include search paths + // extracted from the compiler. Note also that all entries must be + // specified before loading the module. + // + &v.insert<strings> ("config.cxx.header_units", true), + v.insert<process_path> ("cxx.path"), v.insert<dir_paths> ("cxx.sys_lib_dirs"), v.insert<dir_paths> ("cxx.sys_inc_dirs"), - v.insert<strings> ("cxx.poptions"), - v.insert<strings> ("cxx.coptions"), - v.insert<strings> ("cxx.loptions"), - v.insert<strings> ("cxx.libs"), + v.insert<strings> ("cxx.poptions"), + v.insert<strings> ("cxx.coptions"), + v.insert<strings> ("cxx.loptions"), + v.insert<strings> ("cxx.libs"), + &v.insert<strings> ("cxx.header_units"), v["cc.poptions"], v["cc.coptions"], @@ -430,6 +442,9 @@ namespace build2 // for some compilers (e.g., VC) there is no way to signal that the // source is already preprocessed. // + // What about header unit imports? Well, they are in a sense + // standardized precompiled headers so we treat them as includes. + // v.insert<string> ("cxx.preprocessed"), nullptr, // cxx.features.symexport (set in init() below). |