aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-02-03 07:21:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-02-03 09:54:42 +0200
commitc5bbf6be5ba69ff3d5e7ecd79ab32e38f4bdbe69 (patch)
tree558860ec68e40a7669122333a6b7a332d948da43
parent63c81dfeb91bf1bc7a88e871004fa0bca827f7ba (diff)
Mark headers as importable in bdep-new generated projects
-rw-r--r--bdep/new.cxx44
1 files changed, 37 insertions, 7 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index 95998c5..f4174b5 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -1513,6 +1513,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
<< '\n'
<< "h{*}: extension = h" << '\n'
<< "c{*}: extension = c" << '\n';
+
+ os << '\n'
+ << "# Assume headers are importable unless stated otherwise." << '\n'
+ << "#" << '\n'
+ << "h{*}: c.importable = true" << '\n';
+
break;
}
case lang::cxx:
@@ -1528,6 +1534,11 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
if (te) os << "txx{*}: extension = " << pure_ext (*te) << '\n';
os << "cxx{*}: extension = " << pure_ext (xe) << '\n';
+ os << '\n'
+ << "# Assume headers are importable unless stated otherwise." << '\n'
+ << "#" << '\n'
+ << "hxx{*}: cxx.importable = true" << '\n';
+
break;
}
}
@@ -2125,6 +2136,10 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
<< " clean = ($src_root != $out_root)" << '\n'
<< "}" << '\n';
+ if (!exph.empty ())
+ os << '\n'
+ << h << "{export}@./: " << m << ".importable = false" << '\n';
+
if (binless)
{
string pi (pfx_inc.posix_representation ());
@@ -2173,9 +2188,9 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
// <src>/buildfile
//
- // Note that there is no <src>/buildfile for a splitted binless
- // library with the unit tests disabled, since there are no files in
- // <src>/ in this case.
+ // Note that there is no <src>/buildfile for a split binless library
+ // with the unit tests disabled, since there are no files in <src>/ in
+ // this case.
//
if (!(binless && !utest && split))
{
@@ -2281,8 +2296,8 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
else
os << "exe{*.test}: test = true" << '\n';
- // Note that for a splitted binless library all headers in <src>/
- // are presumably for unit tests.
+ // Note that for a split binless library all headers in <src>/ are
+ // presumably for unit tests.
//
os << '\n'
<< "for t: " << x << "{**.test...}" << '\n'
@@ -2314,6 +2329,10 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
<< " clean = ($src_root != $out_root)" << '\n'
<< "}" << '\n';
+ if (!exph.empty () && !split)
+ os << '\n'
+ << h << "{export}@./: " << m << ".importable = false" << '\n';
+
// Build.
//
string pi (pfx_inc.posix_representation ());
@@ -2364,8 +2383,8 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
if (!binless)
os << '\n'
- << "obja{*}: " << m << ".poptions += -D" << mp << "_STATIC_BUILD" << '\n'
- << "objs{*}: " << m << ".poptions += -D" << mp << "_SHARED_BUILD" << '\n';
+ << "{hbmia obja}{*}: " << m << ".poptions += -D" << mp << "_STATIC_BUILD" << '\n'
+ << "{hbmis objs}{*}: " << m << ".poptions += -D" << mp << "_SHARED_BUILD" << '\n';
// Export.
//
@@ -2599,6 +2618,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
<< '\n'
<< "h{*}: extension = h" << '\n'
<< "c{*}: extension = c" << '\n';
+
+ os << '\n'
+ << "# Assume headers are importable unless stated otherwise." << '\n'
+ << "#" << '\n'
+ << "h{*}: c.importable = true" << '\n';
+
break;
}
case lang::cxx:
@@ -2614,6 +2639,11 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
if (te) os << "txx{*}: extension = " << pure_ext (*te) << '\n';
os << "cxx{*}: extension = " << pure_ext (xe) << '\n';
+ os << '\n'
+ << "# Assume headers are importable unless stated otherwise." << '\n'
+ << "#" << '\n'
+ << "hxx{*}: cxx.importable = true" << '\n';
+
break;
}
}