aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-03-18 13:41:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-03-18 13:41:04 +0200
commitbd39e953fee756a492ddfdc000f6128e92b105c4 (patch)
tree5f42492c5e0270db89d4657542fce0f35b0810ba
parentf72fa8c335d1662ab5426410924a3d9adaed0c3d (diff)
Only add mxx{} to buildfiles if its extension was explicitly specified
-rw-r--r--bdep/new.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index 80bb4d8..e5a53ec 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -545,6 +545,9 @@ namespace bdep
string xe; // Source file extension (including leading dot).
string he; // Header file extension (including leading dot unless empty).
+ // @@ In a modular project, mxx is probably more like hxx/cxx rather
+ // than ixx/txx.
+ //
optional<string> ie; // Inline file extension.
optional<string> te; // Template file extension.
optional<string> me; // Module interface extension.
@@ -576,19 +579,19 @@ namespace bdep
//
auto ext = [&opt] (bool s,
const string& v,
- char t,
+ optional<char> t,
const char* d = nullptr) -> optional<string>
{
optional<string> r;
if (s)
r = v;
- else if (opt.extension_specified () || opt.cpp ())
+ else if (t && (opt.extension_specified () || opt.cpp ()))
{
string p (opt.extension_specified () ? opt.extension () :
opt.cpp () ? "?pp" : "");
- replace (p.begin (), p.end (), '?', t);
+ replace (p.begin (), p.end (), '?', *t);
r = move (p);
}
else if (d != nullptr)
@@ -616,7 +619,11 @@ namespace bdep
ie = ext (opt.ixx_specified (), opt.ixx (), 'i', d ? "ixx" : nullptr);
te = ext (opt.txx_specified (), opt.txx (), 't', d ? "txx" : nullptr);
- me = ext (opt.mxx_specified (), opt.mxx (), 'm', d ? "mxx" : nullptr);
+
+ // For now only include mxx in buildfiles if its extension was
+ // explicitly specified with mxx=.
+ //
+ me = ext (opt.mxx_specified (), opt.mxx (), nullopt, nullptr);
if (ie) hs += " ixx";
if (te) hs += " txx";