Commit Graph

20 Commits

Author SHA1 Message Date
David Korth
f0647da5eb Remove CheckHiddenVisibility.cmake.
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.
2025-01-18 22:34:24 -05:00
David Korth
89e07bf47b [lz4] CMakeLists.txt: Set LZ4_LINK_LIBRARY. 2024-08-02 22:42:16 -04:00
David Korth
fd2898dfde Revert "[lz4] CMakeLists.txt: LZ4_LINK_LIBRARY isn't defined anymore; just use lz4."
This didn't work with generator expressions for installation.

This reverts commit ea14ebb1b8.
2024-08-02 22:41:07 -04:00
David Korth
ea14ebb1b8 [lz4] CMakeLists.txt: LZ4_LINK_LIBRARY isn't defined anymore; just use lz4.
Instead of defining LZ4_LINK_LIBRARY, an INTERFACE target 'lz4' is
created that links to either lz4_shared or lz4_static.
2024-08-02 20:53:53 -04:00
David Korth
ace57c011a [lz4] Update: v1.9.4 -> v1.10.0 2024-07-28 20:12:00 -04:00
David Korth
1eb71f4822 [lz4] Don't check for gcc warning flags on MSVC and vice-versa.
This merely wastes time.
2022-10-06 01:02:37 -04:00
David Korth
65d74d9d0d [lz4] Update: v1.9.3 -> v1.9.4 2022-08-15 21:48:18 -04:00
David Korth
28a97ccc2d [extlib] Make sure statically-linked extlibs don't export symbols in libromdata.so.
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.
2022-06-29 22:26:24 -04:00
David Korth
eadcdf9327 Remove "/Gz" for stdcall on i386 when building with MSVC.
I tested a release build and it saved a total of 10,752 bytes.

On the other hand, it had a rather huge maintenance overhead, since I had
to ensure that all extlibs had __cdecl set up in the headers properly,
and this had to be redone on every update.

The i386 build of LZ4 on AppVeyor was failing in tests because of missing
stdcall symbols. I decided not to bother adding stdcall support to LZ4
and simply revert stdcall entirely.
2021-03-31 22:24:17 -04:00
David Korth
5c16a08f6c [lz4] Remove the now-obsolete visual/ subdirectory.
The MSVC projects have been moved to build/.
2021-03-22 01:25:30 -04:00
David Korth
f2d6b4652d [lz4] Update: v1.9.2 -> v1.9.3 2021-03-22 01:18:02 -04:00
David Korth
991618e6c6 [extlib] The PDBs *do* need to be marked as OPTIONAL.
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.
2020-09-20 15:02:50 -04:00
David Korth
777897befa [extlib] Make sure LZ4 and MiniLZO are installed in the Windows package.
Also install the .pdb file.
2020-09-20 14:55:13 -04:00
David Korth
3bb4d04ade [lz4] CMakeLists.txt: Only set the dllexport/dllimport flags on Windows.
This broke the Mac OS X build:

In file included from /Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/lib/lz4.c:110:

/Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/contrib/cmake_unofficial/../../lib/lz4.h:119:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes

LZ4LIB_API int LZ4LIB_CALL LZ4_versionNumber (void);  /**< library version number; useful to check dll version */

^

/Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/contrib/cmake_unofficial/../../lib/lz4.h💯22: note: expanded from macro 'LZ4LIB_API'

.#  define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY

                     ^
2020-09-07 05:01:12 -04:00
David Korth
7b282f5d81 [minilzo] Added an internal copy of MiniLZO.
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.
2020-09-05 11:05:12 -04:00
David Korth
8f76f2cf96 [lz4] Copied over verrsrc.h from zstd.
This should fix the MinGW-w64 build:

[ 16%] Building RC object extlib/lz4/contrib/cmake_unofficial/CMakeFiles/lz4_shared.dir/__/__/visual/VS2017/liblz4-dll/liblz4-dll.rc.obj
C:\projects\rom-properties\extlib\lz4\visual\VS2017\liblz4-dll\liblz4-dll.rc:6:21: fatal error: verrsrc.h: No such file or directory
.#include "verrsrc.h"
                     ^
compilation terminated.
C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\windres.exe: preprocessing failed.
2020-09-05 05:16:30 -04:00
David Korth
a837fcfbfa [lz4] Append 'd' to the DLL filename for debug builds. 2020-09-05 02:53:04 -04:00
David Korth
611e047051 [zstd] Added the Win32 resource file to the DLL build. 2020-09-05 02:47:12 -04:00
David Korth
f5736886de [lz4] Use C linkage using LZ4LIB_CALL.
FIXME: Compiling lz4 with /Gz fails due to C2373 type redefinition
errors, which doesn't make any sense...
2020-09-05 02:42:23 -04:00
David Korth
ad476eb9a0 [lz4] Added a copy of lz4-1.9.2 for PSP CISO. 2020-09-05 02:32:50 -04:00