From 60c2438c4aec9b4bf1c64878534e83152ab7a88e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 24 Jul 2018 10:46:16 +0200 Subject: Switch to new GCC module interface (-fmodule-mapper) --- build2/cxx/init.cxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'build2/cxx') diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index 6621757..1f5eba3 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -182,14 +182,17 @@ namespace build2 } case compiler_id::gcc: { - // Enable starting with GCC 8.0.0 (currently the c++-modules + // Enable starting with GCC 9.0.0 (currently the c++-modules // branch). // if (l && // Barely usable at the moment. - mj >= 8 && + mj >= 9 && ci.version.build.find ("c++-modules") != string::npos) { - r.push_back ("-fmodules"); + // Currently defines __cpp_modules=201804 which is said to + // correspond to p0713 ('module;' leading marker). + // + r.push_back ("-fmodules-ts"); modules = true; } break; @@ -395,14 +398,14 @@ namespace build2 v["cc.module_name"], v["cc.reprocess"], - // Ability to indicate that source is already (partially) - // preprocessed. Valid values are 'none' (not preprocessed), - // 'includes' (no #include directives in source), 'modules' (as above - // plus no module declaration depends on preprocessor, e.g., #ifdef, - // etc), and 'all' (the source is fully preprocessed). Note that for - // 'all' the source can still contain comments and line - // continuations. Note also that for some compilers (e.g., VC) there - // is no way to signal that the source is already preprocessed. + // Ability to signal that source is already (partially) preprocessed. + // Valid values are 'none' (not preprocessed), 'includes' (no #include + // directives in source), 'modules' (as above plus no module + // declaration depends on preprocessor, e.g., #ifdef, etc), and 'all' + // (the source is fully preprocessed). Note that for 'all' the source + // can still contain comments and line continuations. Note also that + // for some compilers (e.g., VC) there is no way to signal that the + // source is already preprocessed. // v.insert ("cxx.preprocessed"), -- cgit v1.1