aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-21 15:57:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-04-21 15:57:01 +0200
commit97fcffa04daf58c9dfed64d5e8360622dc28079d (patch)
tree4f4a1569dec572b121a2e3867a8d0e245002fc1e
parent30b2072d97f4fd85fced160812e9ffe0e1183a27 (diff)
Improve export header generated by bdep-new
-rw-r--r--bdep/new.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index 0949b1e..0b6f766 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -1682,11 +1682,16 @@ namespace bdep
<< "#else" << endl
<< "// If none of the above macros are defined, then we assume we are being used" << endl
<< "// by some third-party build system that cannot/doesn't signal the library" << endl
- << "// type. Note that this fallback works for both static and shared but in case" << endl
- << "// of shared will be sub-optimal compared to having dllimport." << endl
- << "//" << endl
+ << "// type. Note that this fallback works for both static and shared libraries" << endl
+ << "// provided the library only exports functions (in other words, no global" << endl
+ << "// exported data) and for the shared case the result will be sub-optimal" << endl
+ << "// compared to having dllimport. If, however, your library does export data," << endl
+ << "// then you will probably want to replace the fallback with the (commented" << endl
+ << "// out) error since it won't work for the shared case." << endl
+ << "//" << endl
<< "# define " << mp << "_SYMEXPORT // Using static or shared." << endl
- << "#endif" << endl;
+ << "//# error define " << mp << "_STATIC or " << mp << "_SHARED preprocessor macro to signal " << n << " library type being linked" << endl
+ << "#endif" << endl;
os.close ();
}