aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-11-02 11:18:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-11-02 17:14:47 +0300
commit87b202a805f5aee48896abfc8be8886acdbd99d0 (patch)
tree687e4f73c7e0050607555714ebd110ab344ec21e
parenta31834a794394d89bc593671fe5460a93f817d41 (diff)
In no-symexport bdep-new library mode add commented out symexport-related macro definitions to buildfile
-rw-r--r--bdep/new.cxx31
1 files changed, 19 insertions, 12 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index 15084cc..5488aa5 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -388,8 +388,9 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
bool utest (false); // unit-tests
bool install (false); // !no-install
bool ver (false); // !no-version
- bool symexport (false); // !no-symexport && !binless
+ bool no_symexport (false); // no-symexport
bool auto_symexport (false); // auto-symexport
+ bool symexport (false); // !no-symexport && !binless
string license;
bool license_o (false);
@@ -430,19 +431,22 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
license_o = t.lib_opt.license_specified ();
}
- if (t.lib_opt.auto_symexport ())
+ no_symexport = t.lib_opt.no_symexport ();
+ auto_symexport = t.lib_opt.auto_symexport ();
+
+ if (auto_symexport)
{
if (binless)
fail << "both --type|-t,binless and --type|-t,auto-symexport "
<< "specified";
- if (t.lib_opt.no_symexport ())
+ if (no_symexport)
fail << "both --type|-t,no-symexport and --type|-t,auto-symexport "
<< "specified";
}
- symexport = !t.lib_opt.no_symexport () && !binless;
- auto_symexport = t.lib_opt.auto_symexport ();
+ symexport = !no_symexport && !binless;
+
break;
}
case type::bare:
@@ -2841,13 +2845,14 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
os << mc << ".poptions =+ \"-I" << opi << "\" \"-I" << spi << '"' << '\n';
}
- if (symexport)
+ if (!binless)
{
if (!auto_symexport)
os << '\n'
- << "{hbmia obja}{*}: " << mc << ".poptions += -D" << mx << "_STATIC_BUILD" << '\n'
- << "{hbmis objs}{*}: " << mc << ".poptions += -D" << mx << "_SHARED_BUILD" << '\n';
-
+ << (no_symexport ? "#" : "") << "{hbmia obja}{*}: " <<
+ mc << ".poptions += -D" << mx << "_STATIC_BUILD" << '\n'
+ << (no_symexport ? "#" : "") << "{hbmis objs}{*}: " <<
+ mc << ".poptions += -D" << mx << "_SHARED_BUILD" << '\n';
else
os << '\n'
<< "if ($" << mp << ".target.system == 'mingw32')" << '\n'
@@ -2870,10 +2875,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
<< "}" << '\n';
}
- if (symexport && !auto_symexport)
+ if (!binless && !auto_symexport)
os << '\n'
- << "liba{" << s << "}: " << mc << ".export.poptions += -D" << mx << "_STATIC" << '\n'
- << "libs{" << s << "}: " << mc << ".export.poptions += -D" << mx << "_SHARED" << '\n';
+ << (no_symexport ? "#" : "") << "liba{" << s << "}: " <<
+ mc << ".export.poptions += -D" << mx << "_STATIC" << '\n'
+ << (no_symexport ? "#" : "") << "libs{" << s << "}: " <<
+ mc << ".export.poptions += -D" << mx << "_SHARED" << '\n';
// Library versioning.
//