From a14b9bc18431c6aed8441261d28b6ff20bd25935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Apr 2019 14:44:32 +0200 Subject: Initial take on header unit and include translation support --- build2/cxx/init.cxx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'build2/cxx') 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 ("config.cxx.loptions", true), v.insert ("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 ("config.cxx.header_units", true), + v.insert ("cxx.path"), v.insert ("cxx.sys_lib_dirs"), v.insert ("cxx.sys_inc_dirs"), - v.insert ("cxx.poptions"), - v.insert ("cxx.coptions"), - v.insert ("cxx.loptions"), - v.insert ("cxx.libs"), + v.insert ("cxx.poptions"), + v.insert ("cxx.coptions"), + v.insert ("cxx.loptions"), + v.insert ("cxx.libs"), + &v.insert ("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 ("cxx.preprocessed"), nullptr, // cxx.features.symexport (set in init() below). -- cgit v1.1