private export

Dominik Haumann dhaumann at kde.org
Wed Oct 15 18:34:49 UTC 2014


On Tuesday 14 October 2014 14:37:30 Jeremy Whiting wrote:
> Hello,
> 
> In KNewStuff autotests there are two disabled tests that build and
> work if I export the Author and EntryInternal classes, but these two
> classes are private (declared in _p.h files) so I'd rather not export
> them, since they aren't public api. Is there a way to have them
> exported when BUILD_TESTING is set only? I didn't see anything obvious
> in the knewstuff_export.h generated header. I guess I could have the
> class declarations wrapped in #ifdef BUILD_TESTING but that seems like
> a hack. Is there a proper way to only export private classes when
> building and running tests?

In KTextEditor we use a KTEXTEDITOR_PRIVATE_EXPORT macro that is the same as 
KTEXTEDITOR_EXPORT, but do not install the headers. Yes there are more symbols 
in the .so, but without headers it's not of much help.

Greetings
Dominik



More information about the Kde-frameworks-devel mailing list