The root CMakeLists.txt has a minimum CMake version of 3.5, and
CheckHiddenVisibility.cmake's workarounds are only needed for
CMake 3.2 and earlier.
Set CMP0063 unconditionally (added in CMake 3.3) and set the
CMAKE_<LANG>_VISIBILITY_PRESET and CMAKE_VISIBILITY_INLINES_HIDDEN
variables where CHECK_HIDDEN_VISIBILITY() was called before.
There should effectively be no code changes with this commit.
Something changed that caused the build on Xubuntu 16.04 (32-bit) to fail:
[ 63%] Linking CXX shared library ../../lib/libromdata.so
/usr/bin/ld: read-only segment has dynamic IFUNC relocations; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status
src/libromdata/CMakeFiles/romdata.dir/build.make:3614: recipe for target 'lib/libromdata.so.6.0' failed
make[2]: *** [lib/libromdata.so.6.0] Error 1
Setting POSITION_INDEPENDENT_CODE instead of "-fpic -fPIC" fixes this.
[extlib] Correctly set properties on the 'mspack' target instead of
'libmspack'. Otherwise, libmspack won't have either EXCLUDE_FROM_ALL
or POSITION_INDEPENDENT_CODE.
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.
We're technically installing both the Debug and Release files, but only
one will exist at any given time, so it has to be OPTIONAL.
[libpng] CMakeLists.txt: Minor formatting improvements.
I chose MiniLZO instead of regular LZO because we only need to be able to
decompress LZO1X blocks.
[libromdata] CisoPspReader: Don't call lzo_init() if this JISO isn't
actually using LZO. Otherwise, if the DLL is missing on Windows, the
program will crash.