aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-20 10:19:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-20 10:19:08 +0200
commit0a6212e277d55fff72f3d9df53a4dcb88e3e4a71 (patch)
treebb3efd126b8d2ec885eeeadc26a4a18bf24fdca2 /build2/cc/compile.cxx
parent11b477a588efd5369afa29cf65c7fb58377d0649 (diff)
Force Clang not to reference source files from BMIs, add trace
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r--build2/cc/compile.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx
index c23eff2..c90cf08 100644
--- a/build2/cc/compile.cxx
+++ b/build2/cc/compile.cxx
@@ -2512,6 +2512,8 @@ namespace build2
module_imports&& imports,
sha256& cs) const
{
+ tracer trace (x, "compile::search_modules");
+
// So we have a list of imports and a list of "potential" module
// prerequisites. They are potential in the sense that they may or may
// not be required by this translation unit. In other words, they are
@@ -2690,7 +2692,7 @@ namespace build2
// if all the modules come from libraries. Which will be fairly common
// (think of all the tests) so it's worth optimizing for.
//
- auto check = [&imports, &pts, &match, start, n]
+ auto check = [&trace, &imports, &pts, &match, start, n]
(const target* pt, const string& name, bool fuzzy) -> bool
{
bool done (true);
@@ -2707,6 +2709,8 @@ namespace build2
match (name, m.name) :
(name == m.name ? n + 1 : 0));
+ l5 ([&]{trace << name << " ~ " << m.name << ": " << s;});
+
if (s > m.score)
{
pts[start + i] = pt;
@@ -3221,6 +3225,13 @@ namespace build2
args.push_back (relm.string ().c_str ());
args.push_back ("--precompile");
+ // Without this option Clang's .pcm will reference source files.
+ // In our case this file may be transient (.ii). Plus, it won't
+ // play nice with distributed compilation.
+ //
+ args.push_back ("-Xclang");
+ args.push_back ("-fmodules-embed-all-files");
+
// These should become the default at some point.
//
args.push_back ("-Xclang"); args.push_back ("-fmodules-codegen");