For most libraries, this merely required adding hidden visibility
flags to the CMakeLists.txt files. zlib-ng was a bit finicky,
and TinyXML2 needed a new macro, TINYXML2_NO_GCC_EXPORT.
TODO: zstd isn't currently used by libromdata.so. If I make use of it
later, either directly or indirectly via minizip, update it to not
export symbols when statically linking to it on Linux.
APNG_dlopen.c: Rework this file so it's always compiled regardless of
USE_INTERNAL_PNG and USE_INTERNAL_PNG_DLL. It exports two symbols,
APNG_ref() and APNG_unref(). When using the statically-linked libpng,
these functions are now no-ops, but they still need to be exported.
FIXME: Building tinyxml2 as a static library fails on my system:
/usr/bin/objcopy: illegal pathname found in archive member: /home/david/p/m/lib/../extlib/tinyxml2/CMakeFiles/tinyxml2.dir/tinyxml2.cpp.o
This seems to be a binutils security fix for CVE-2014-9447.
Unfortunately, cmake ends up using the full pathname in the static
library, which has a '..' because of the custom lib path.
Among other things, this update adds in reporting of the location oc
parsing errors, which was present in the original TinyXML but not
earlier versions of TinyXML2.
TinyXML2 will be used to parse Windows manifests.
The Ubuntu 17.04 64-bit dynamic library build is around 83 KB, so
this won't add too much to the executable size.
TODO:
- Use the system TinyXML2 if available.
- Compile as a DLL? (with delay loading on Windows, maybe)