From 43c53a8b475f901a902ba1bf6ec603e7a28311b1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 May 2019 09:18:09 +0200 Subject: Adjust modules support enablement for GCC Now we require c++-modules-ex branch unless forced. --- build2/cxx/init.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'build2') diff --git a/build2/cxx/init.cxx b/build2/cxx/init.cxx index adb1d92..3fb636f 100644 --- a/build2/cxx/init.cxx +++ b/build2/cxx/init.cxx @@ -293,11 +293,15 @@ namespace build2 } case compiler_type::gcc: { - // Enable starting with GCC 9.0.0 (currently the c++-modules - // branch). + // We now use extended/experimental module mapper support which + // is currently only available in our c++-modules-ex branch. + // But let's allow forcing it to plain c++-modules in case + // things got merged, etc. // - if (mj >= 9 && - ci.version.build.find ("c++-modules") != string::npos) + if (mj >= 10 && + ci.version.build.find (l + ? "c++-modules" + : "c++-modules-ex") != string::npos) { // Currently defines __cpp_modules=201810 which is said to // correspond to p1103 (merged modules). @@ -316,6 +320,9 @@ namespace build2 // // Also see Clang modules support hack in cc::compile. // + // @@ Clang 9 enables modules by default in C++2a. We should + // probably reflect this in the modules value. + // if (mj >= 6) { r.push_back ("-D__cpp_modules=201704"); // p0629r0 -- cgit v1.1