mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Hide most of non-public symbols by default (#984)
* Export YAML::detail::node::m_amount The internal header node/detail/node.h is included by public headers; YAML::detail::node is implemented in the header itself, and thus it gets inlined... except for its static m_amount class member, which is instantiated in the library only. Right now all the symbols of yaml-cpp are exported (nothing is hidden), so the linker will find node::m_amount in the yaml-cpp library. As solution/workaround, explicitly export YAML::detail::node::m_amount. * CMake: use GenerateExportHeader Make use of the GenerateExportHeader CMake module to generate the dll.h header with export macros. While the produced dll.h is different, the result should be the same, i.e. nothing changes for yaml-cpp or its users. * CMake: hide all the symbols by default Hide all the symbols that are not explicitly exported with YAML_CPP_API. This way the ABI will be way smaller, and only actually exposing the public classes/functions.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace YAML {
|
||||
namespace detail {
|
||||
std::atomic<size_t> node::m_amount{0};
|
||||
YAML_CPP_API std::atomic<size_t> node::m_amount{0};
|
||||
|
||||
const std::string& node_data::empty_scalar() {
|
||||
static const std::string svalue;
|
||||
|
Reference in New Issue
Block a user