ZISO is basically CISO v0/v1 but with LZ4 instead of zlib.
CISO v2 can use either zlib or LZ4 on a per-block basis.
[cmake] Added LZ4 checks.
- TODO: Add an internal copy of LZ4.
This is useful for cases where the thumbnailer cannot download files or
write to the user's cache directory. libgnome-desktop, when configured
with bubblewrap enabled, doesn't allow access to the home directory
(aside from the file being thumbnailed), but *does* allow access to the
/usr/ directory.
Three cases are now possible, depending on if a cache file is present in
the system-wide cache directory and/or the user's cache directory:
- IS in system-wide, NOT in user's: Use the system-wide version.
- IS in system-wide, AND in user's: Use the user's version.
- NOT in system-wide: Use the user's version, calling rp-download if the
file doesn't exist.
New MIME type files:
- xdg/mime.no-thumbnail.types (types that don't have supported thumbnails)
- xdg/mime.thumbnail.types (types that have supported thumbnails)
These are now read at CMake time and are used to generate the .desktop
and .thumbnailer files.
The mime.types files are one line per MIME type, which is easier to work
with than a single line of everything.
The GTK+ .thumbnailer files only have mime.thumbnail.types, whereas the
KDE .desktop files have both thumbnail and no-thumbnail.
TODO: Sort and remove duplicates?
Also: Cleaned up installation of the .desktop/.thumbnail files. Removed
the explicit source/binary directories, since these functions have good
defaults:
- CONFIGURE_FILE() uses source dir for source, binary dir for destination.
- INSTALL() defaults to binary dir.
Added some MIME types from RomData subclasses that weren't added before:
- iQuePlayer
- PokemonMini
- DidjTex
- KhronosKTX2
- PowerVR3
- SegaPVR (image/x-sega-svr only)
MiniZip 2.10.0 added support for zstd as a compression method, so we
should support it.
Note that a system version of zstd is preferred on Linux systems.
Enabled the MiniZip test tools for manual builds only. Info-ZIP hasn't
been updated in a while, so I'm going to use the MiniZip test tools to
compress ZIP archives using zstd.
Enabled MiniZip compression in order to compress stuff using the minizip
test program.
mz_strm_zstd.c: FIXME: Compression level doesn't work. Hard-coded the
maximum compression level for now.
The variables have been (mostly) renamed to GTK2, though the user-facing
variable is still BUILD_XFCE, and it shows "XFCE" in the UI_FRONTENDS
status message.
I don't know if I'll be adding support for old GTK+ 2.x Nautilus
versions...
Same sort of dynamic loading as the Nautilus version, but with separate
plugin initialization code.
thunarx-mini.h: Definitions of various ThunarX structs, since we no longer
use the system-wide version.
Use G_DEFINE_DYNAMIC_TYPE_EXTENDED() instead of the ThunarX version.
Note that for RpThunarProvider, we need to use G_IMPLEMENT_INTERFACE_DYNAMIC().
G_IMPLEMENT_INTERFACE() crashes at runtime, even though the ThunarX
version worked fine. (Presumably, the ThunarX version was actually the
same as the glib DYNAMIC version...)
Added dummy class_finalize() functions, which are needed by the
G_DEFINE_DYNAMIC_TYPE_EXTENDED() macro.
The only differences are symbol names, which we can resolve at runtime.
Export all three plugin symbols. Depending on which initialization
function is called, we'll dlopen() the appropriate library and load
the symbols.
TODO:
- Create symlinks for the MATE and Cinnamon plugins.
- Update Debian packages to install symlinks.
- Other testing.
Note that we don't need to implement runtime fallbacks to stat():
1. If statx() isn't available at compile time, stat() will be used
regardless.
2. If glibc supports statx() but the kernel doesn't, glibc will
emulate statx(). This might introduce some extra overhead, but
it's easier to work with.
3. The BSDs keep their libc in sync with the kernel, so there's no
possibility that libc will support statx() if the kernel doesn't.
The os-secure files from rpcli and rp-download have been consolidated
into a single library. seccomp-debug.h has also been moved here and
converted into a .c file with a public interface in the .h file.
rpcli and rp-download can now call rp_secure_enable() with an OS-specific
parameter. A struct is provided that makes the parameter type-safe.
NOTE: syscall_wl (seccomp syscall whitelist) can't be NULL-terminated,
since syscall 0 is valid on most architectures. On x86, it's read().
Hence, we're specifying an explicit array size.
Also moved the Win32 security options and integrity level files here.
Updated Win32 code for this change.
integrity_level.c: Removed the pthread_once() usage for the Windows Vista
check, since we're not linking to librpthreads. The worst that could happen
is both threads set isVista to the same value.
[cmake] Adjusted security options:
- USE_SECCOMP: Moved from cmake/options.cmake to librpsecure/CMakeLists.txt.
- ENABLE_SECCOMP_DEBUG: Added to librpsecure/CMakeLists.txt. Replaces
the hard-coded SECCOMP_DEBUG in seccomp-debug.h.
[svrplus] Removed the libwin32common dependency. It was only used for the
Windows security options, and that's now handled by librpsecure.
[tests] Updated gtest_init.cpp to use librpsecure. Link all test suites to
librpsecure instead of libwin32common.
- TODO: seccomp() on Linux, pledge() on OpenBSD.
This should ensure better utilization of precompiled headers in gcc builds.
Note that ${CMAKE_BUILD_TYPE} is not necessarily all uppercase, so
convert it to uppercase before using it.
CMakeLists.txt: Make sure CMAKE_BUILD_TYPE gets cached as "Release" if it
isn't specified on the command line.
TODO: Do we need to ensure that ADD_COMPILED_HEADER() is added *after* all
flags/definitions are set, or does the ordering not matter?
This fixes the build on Ubuntu 14.04 with precompiled headers enabled.
Updated the compiler flag CMake files to use functions instead of macros
and to only check for functionality once regardless of how many times the
function is invoked. Among other things, this lets us remove the UNSET()
calls, since local variables are automatically deleted after returning
from the function.
FIXME: Make sure gcc is actually using the precompiled headers...
This seems to be needed on Ubuntu 14.04 for Thunar (GTK+ 2.x).
Newer versions have the extension directory defined in the pkgconfig
file, so it's not an issue there.
It's a bit more restrictive than rp-download, since rpcli doesn't need
to access the Internet.
Moved Win32 security option initialization to an os-secure file as well
for consistency.
Moved the OpenBSD pledge()/tame() check to a CMake macro file.
OpenBSD (and probably other BSDs) are similar to Mac OS X in that they
have a 64-bit off_t and no off64_t. Detect this correctly using cmake
macros and handle it in config.libc.h.in.
config.libc.h is force-included using command line parameters, similar
to c++11-compat.h. We can't simply add the binary directory to
INCLUDE_DIRECTORIES() because this breaks other CMake checks, since
CMake doesn't use INCLUDE_DIRECTORIES() when checking stuff.
I decided to try building rom-properties with MSVC 2019's ARM compilers,
and it seems to build properly. I can't test it at the moment, though.
CMake changes:
- ${CMAKE_SYSTEM_PROCESSOR} is always set to the host CPU. Check
_MSVC_C_ARCHITECTURE_FAMILY to determine the real CPU, then set
CMAKE_SYSTEM_PROCESSOR accordingly.
- Enable /EHsc if it isn't set already. It's set by CMake for i386
and amd64, but not for ARM or ARM64.
- Minimum subsystem version for ARM and ARM64 is 6.2. (Windows 8)
- Added some Win32 libraries that are included by default on i386 and
amd64, but not on ARM or ARM64.
- Reference: https://pete.akeo.ie/2017/05/compiling-desktop-arm-applications-with.html
Source changes:
- DelayLoadHelper.c, rp-config.c: Added subdirectory names for
ia64, ARM, and ARM64.
- TODO: Consolidate this into a common header file?
FIXME: Maybe we should use RP_LINKER_FLAGS_WIN32_EXE and
RP_LINKER_FLAGS_CONSOLE_EXE on MSVC. (We're using this on gcc.)
Not sure why I used one method or the other...
Using GCR_Cmake macros from: https://github.com/Makman2/GCR_CMake
Currently loading the full 16x16 sprite sheet as the icon for each
dropdown entry. This is obviously wrong, but it works as a basic
test for now.
PIMGTYPE.cpp: New function PIMGTYPE_load_png_from_gresource(). This
function loads a PNG image from the glibresources and returns it as
PIMGTYPE. This does *not* use rp_image at all; it uses Cairo's
built-in PNG loading functionality.
TODO: GdkPixbuf version.
Related bug report for LibreOffice:
https://bugs.documentfoundation.org/show_bug.cgi?id=125922
NOTE: dll-search.c still checks for "KDE5" for compatibility.
NOTE 2 We did NOT include "KDE5" in the forwarding plugins for
compatibility because they shouldn't be mixed-and-matched with
rom-properties versions.
The AppArmor profile has the following permissions, with everything else
denied:
- Allow TCP network access to download from online image databases.
- Allow read access to rom-properties.conf.
- Allow write access to .cache/rom-properties/.
This ensures we can add it after liboldwincompat.
This fixes EncodePointer() and DecodePointer() being used from
kernel32.lib instead of liboldwincompat in rom-properties.dll.
Enabled by default on MSVC only.
travis-ci still uses Ubuntu 14.04, and PrecompiledHeader.cmake doesn't
seem to pass the `-std=gnu++11` option properly, so gcc-4.8 ends up
failing.
TODO: Use cmake-3.16.0's built-in PCH support if available.
Nemo is yet another Nautilus fork. Nemo was initially forked from
Nautilus 3.x, so we don't have to worry about GTK+ 2.x versions.
Everything's basically the same as the Caja version, except the
files are named "nemo" instead of "caja".
It seems that the R and B channels are backwards, so we'll need to fix
that next. Other than that, both 2bpp and 4bpp decoding seems to work.
(A lot better than my terrible attempt, at least.)
[cmake] options.cmake: Added an option for PVRTC. The code is licensed
under the MIT license, but we might as well provide an option for it
because it's third-party code instead of my own code.
TODO:
- Fix R/B channel ordering.
- PVRTC-II decoding?
- Add PVRTC decoding to KTX and DDS.
This allows us to eliminate the OpenGL dependency, which lets us get rid
of the CMake option ENABLE_GL.
Removed all ENABLE_GL checks.
Removed #include "config.librptexture.h" where it's no longer needed.
When building with MinGW-w64, the manifests were being written with "x86"
even for 64-bit, which caused Windows to outright refuse to run the
program with no error message.
The check in platform.cmake checks both CMAKE_CL_64 and sizeof(void*),
so remove the one in platform/win32.cmake.
Also added untested checks for ARM/ARM64.
TODO: Verify cross-compile functionality.
JPEG decoding isn't as strictly checked as PNG decoding, and we don't
need specific JPEG writing functionality e.g. for APNGs and tEXt chunks,
so we can drop the libjpeg-turbo requirement on Windows.
This reduces the Windows distribution by around 1 MB uncompressed.
(521 KB for the 32-bit jpeg62.dll; 535 KB for the 64-bit jpeg32.dll.)
Related: Commit f548b5372d
(Removed the GDI+ PNG loader; renamed RpPng_libpng.cpp to RpPng.cpp.)
[librptexture] rp_image_backend: Allow width and height to be 0 if the
specified format is rp_image::FORMAT_NONE. This is done by
RpGdiplusBackend when constructing a backend using an existing
Gdiplus::Bitmap.
HAS_LD_COMPRESS_DEBUG_SECTIONS isn't actually being set. It was probably
set while I was testing stuff, but it got removed before committing in
commit 107224487f.
([cmake] Reworked --compress-debug-sections logic for compatibility with older systems.)
GNU ld treats these as the same, but clang ld requires a value to be
specified.
This fixes a regression on FreeBSD from commit 107224487f.
([cmake] Reworked --compress-debug-sections logic for compatibility with older systems.)
Ubuntu 14.04's ld (binutils-2.24) doesn't have --compress-debug-sections,
which causes travis-ci to fail.
cmake-3.6's try_compile() attempts to build an executable by default,
which *should* test the linker flags, but that isn't working, either.
Ubuntu 14.04 has cmake-3.3, so that wouldn't help anyway.
Instead, check the output of `ld --help` for the various options.
This seems to work for the most part.
Enabled this method for Mac OS X as well.
If the --compress-debug-sections=zlib linker test fails, then we'll
fall back to the old objcopy method. SplitDebugInformation.cmake uses
the same detection method to check if objcopy supports the option,
and if it does, it uses it.
Added our own copy for older CMake versions.
TextFuncs_iconv.cpp: #include </usr/include/iconv.h> on FreeBSD and
other non-Linux systems. This works around an issue where libiconv
takes over the default iconv.h if libiconv is installed *and* the
system has its own iconv(), which happens on FreeBSD 10.0 and later.
FIXME: The following TextFuncsTests are failing on FreeBSD 12.0:
- cp1252_to_utf8
- cp1252_to_utf16
- cp1252_sjis_to_utf8_fallback
- cp1252_sjis_to_utf16_fallback
- utf8_to_utf16
FreeBSD's objcopy doesn't have --compress-debug-sections, but ld does.
On Linux, this does provide an advantage over the previous method because
ld compresses the debug sections when creating the original executable,
which results in less disk access.
Three compression options are available in GNU ld:
- zlib-gnu: Use .zdebug_* sections.
- zlib-gabi: Use .debug_* sections with the C flag.
- zlib: Same as zlib-gabi.
FreeBSD's zlib option is the same as GNU ld's zlib/zlib-gabi option,
so we'll use it on all platforms.
NOTE: FreeBSD's default toolchain is llvm/clang as of FreeBSD 10.0, so
this should apply to other systems using llvm/clang.
S2TC was originally implemented because the S3TC patents were still in
effect. The patents expired in October 2017, which was *before* the
release of v1.2 (the first version with S3TC decoding), but I didn't want
to remove it so close to release.
Pretty much no one used the S2TC version, so it was just wasting space.
Code size reduction: (64-bit Gentoo Linux, gcc-9.1.0, release build)
text data bss dec hex filename
17058 9 0 17067 42ab ImageDecoder_S3TC.cpp.o [before]
13138 8 0 13146 335a ImageDecoder_S3TC.cpp.o [after]
-3920 -1 0 -3921 -f51 Difference
This fixes a ton of instances of the following warning, introduced in
cmake-3.14.0:
CMake Warning (dev) at cmake/libs/CheckGettext.cmake:30 (SET):
implicitly converting 'msgfmt executable.' to 'STRING' type.
Call Stack (most recent call first):
src/libi18n/CMakeLists.txt:9 (CHECK_GETTEXT)
This warning is for project developers. Use -Wno-dev to suppress it.
Caja is a fork of Nautilus 2.x, so everything's basically the same
as the GNOME extension, but with a different prefix.
Note that as of MATE 1.18.0, GTK+ 3.x is used, not 2.x. We're only
supporting GTK+ 3.x for MATE Desktop.
N.B.: Caja is a fork of Nautilus *2.x*, not *3.x*. The extension
interface doesn't seem to have changed, though.
Since the only real changes are names, the mate extension is handled
similarly to xfce3. The subdirectory has a CMakeLists file and defines
an RP_UI_GTK3_MATE macro, but it references the files in the gnome
directory.
gnome: Define RP_UI_GTK3_GNOME to distinguish between the two.
RomDataView: MATE uses the same settings as GNOME.
NOTE: We can't set up the MATE Debian configuration right now, since
Ubuntu 16.04 has a GTK+ 2.x version of MATE. I might set up a separate
"later-debian" directory with the updated files, though.
TODO:
- Both GNOME and MATE use /usr/share/thumbnailers, so the thumbnailer
file needs to be moved to a common package.
- Caja has an "About Extension" button. Implement this.
- Check Nautilus and other file browsers?
- Make sure all relevant MIME types are added to the XDG service files.
Caja *requires* the proper MIME types to be added, or else it won't
thumbnail the files.
If nautilus-extension.h is present, use it. Otherwise, use the file
from libnautilus-extension/ directly.
FindLibNautilusExtension: s/ThunarX2/libnautilus-extension/g
This uses Kreon drive firmware commands to unlock Xbox disc
reading commands.
rpcli on Linux can now list Xbox discs directly, though the
required ioctl is blocked if not running as root.
FIXME: The Windows build is probably broken right now.
This is a stripped-down version of libmspack containing only the necessary
functionality for Xbox 360 executables.
Xenia commit: e706cf0d5413c31b7e80a50411cc88cc7c71af30
License: LGPLv2.1
config.h.in: Modified for cmake; removed unnecessary checks.
debian/copyright: Added copyright information.
cmake/options.cmake: Added an ENABLE_LIBMSPACK option. (default is ON)
FindOpenGL.cmake doesn't set OPENGL_INCLUDE_DIR on Windows, but it does
set OPENGL_gl_LIBRARY.
For OpenGL preference: We're only using the GL headers, not the
libraries. cmake-3.11 added an option to switch between Legacy and
GLVND, and if the option isn't set, a warning is printed.
This will be used to show a UAC shield on Nintendo 3DS ROM images (and
later Nintendo Switch ROM images) that have "dangerous" permissions set.
Currently, it's set to show on *all* files, not just the relevant ones.
[cmake] win32.cmake: Increased the SDK version to Windows Vista (0x0600)
in order to use SHGetStockIconInfo() and related definitions.
TODO:
- Add a function to RomData to check if the file has "dangerous"
permissions set. (default will be no)
- Add a fallback for Windows XP, which does support overlay icons,
but is missing the following:
- UAC shield icon
- SHGetStockIconInfo()
Subclasses no longer have to implement the full readBlock() function.
Instead, they can implement getPhysBlockAddr(), which returns the
starting address of the specified physical block address.
Implemented readBlock() in SparseDiscReader. If a subclass doesn't
implement readBlock(), the default one will be used, which calls the
getPhysBlockAddr() function.
Updated all SparseDiscReader subclasses to use getPhysBlockAddr()
instead of readBlock(), *except* for GdiReader, which has to implement
its own readBlock() function because each track is stored in a separate
file.
This fixes issue #144: SparseDiscReader: Change readBlock() to
getBlockStart() or similar.
TODO: Test all affected formats before merging. 2352-byte CD images
and GDI images have been tested, but CISO, WBFS, and WUX have not.
This will be used to decompress Atari ST SNDH files.
Note that unice68 is GPLv3, so there's a compile-time option to
disable it.
TODO: Make it a DLL/SO instead and use dlopen().
[libromdata/tests] GcnFstTest: Copy/paste error caused i18n to be
linked to GcnFstPrint (twice) instead of GcnFstTest.
[win32] Added the TinyXML2 include directory.
[libromdata] Likewise. (though it probably isn't needed...)
[cmake] CheckTinyXML2.cmake: Set TINYXML2_INCLUDE_DIR if using the
internal copy.
https://github.com/nmoinvaz/minizip
[extlib] CMakeLists.txt: Disabled MiniZip compression. We're currently
only using it for decompression, so there's no need to build the
compression code, which wastes time and disk space.
All of the code is basically the same as xfce2, but the library
dependencies have changed.
- FindThunarX3.cmake: Find the GTK+ 3.x version of ThunarX.
- xfce3/CMakeLists.txt is a clone of xfce/CMakeLists.txt. It references
all of the sources from the xfce/ directory.
- Thunar 1.8.0 doesn't change the formatting in the properties dialog,
so RP_DFT_XFCE is kept as-is.
- #undef GTK_DISABLE_DEPRECATED in a few places because thunar-renamer.h
uses GtkVBox, which is deprecated in GTK+ 3.x.
- doc/COMPILING.md: Added rom-properties-xfce3.
TODO: Add a Debian package once it's added to the repository.
Starting with GTK+ 3.10, GtkImage provides a function to set its image
from a Cairo surface. Cairo uses the same ARGB32 pixel format as
rp_image, so using a Cairo surface instead of a GdkPixbuf eliminates the
need to swap the R and B channels.
Consequently, there is no SSSE3 code for CairoImageConv, since we're
just doing a plain old memcpy().
PIMGTYPE.hpp: New header with a typedef PIMGTYPE, which is either
GdkPixbuf* or cairo_surface_t*, depending on GTK+ version. Also defines
RP_GTK_USE_CAIRO if using Cairo, and has wrapper functions for PIMGTYPE.
Updated CreateThumbnail and RomDataView to use PIMGTYPE where applicable.
TODO: CreateThumbnailPrivate::rescaleImgClass() is not currently
implemented for Cairo.
We need to check CMAKE_CL_64, not just ${CMAKE_SYSTEM_PROCESSOR}, since
that variable indicates the host system, which is always 64-bit
regardless of the target architecture.
This fixes the 32-bit rp-config.exe. (rom-properties.dll didn't load
comctl32.dll due to the incorrect manifest, resulting in KeyManagerTab
crashing because GetModuleHandle(L"COMCTL32") returned nullptr.)
cmake/options.cmake: Unset QT_SELECT initially.
Set QT_SELECT in each individual directory based on the required version.
For libunixcommon, set it, call the required program, then unset it.
This should fix all of the issues:
- Qt4: If set to 5, qmake would fail to detect Qt/X11.
- Qt5: If set to 4, the plugin path was wrong.
This caused byteswapping tests to fail, and ImageDecoderLinearTest and
ImageDecoderTest both crashed.
It seems the IFUNC resolver function *was* being called, but the returned
function pointer wasn't. I'm not sure why.
This fixes tests on Xubuntu 16.04.
TODO: Test on gcc6.
C4024: 'function': different types for formal and actual parameter n
C4047: 'function': 'parameter' differs in levels of indirection from 'argument'
NOTE: /sdl doesn't do this.
The gettext libraries and executables were built on Ubuntu 18.04 using
MinGW-w64 with gcc-7.3.0.
iconv support has been disabled for the runtime, but it's still needed
for some of the build executables. For that, we're using win-iconv, which
is an iconv wrapper that uses the Windows API. [1]
In addition, several patches from the official MinGW package repository
were applied to gettext-0.19.8.1 in order to get it to build correctly
for Windows. [2]
TODO:
- Test packaging to ensure the correct DLL is packaged.
- Test bindtextdomain() to determine if it supports Unicode. If it
doesn't, then another patch will be needed.
[1] https://github.com/win-iconv/win-iconv
[2] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
The default value is AUTO. If set to ON, CMake will fail if the
required packages are missing.
NOTE: OPTION() only supports BOOL. Use SET() and SET_PROPERTY() for
tristate support.
- Reference: https://cmake.org/pipermail/cmake/2016-October/064342.html
NOTE 2: libunixcommon still searches for the packages unconditionally
because it's used for rp-stub's search path.
Based on some of the code by @DankRank in issue #119.
(Use templates instead of including 30 nearly-identical files in
RomDataFactory)
Removed CheckCXX11LambdaAsFunctionPointer.cmake, since this functionality
was only ever used in RomDataFactory.
TODO: Initialize in the DLL and/or EXE entry point.
TODO: Search the DLL directories on Windows.
Added ENABLE_NLS. (defaults to OFF on Windows for now)
Thread-safe static initialization requires Vista or later, since XP
doesn't have enough TLS slots.
NOTE: We need to make sure that we use pthread_once() for one-time init
instead of using a static initializer.
NOTE: We're not linking to TinyXML2::tinyxml2 in libromdata because this
target only exists if it's found as a system library. Maybe we should
create it for the extlib version as well...
This allows the images to be decoded, but with lower quality.
Removed ENABLE_S3TC checks from all files except ImageDecoder_S3TC.cpp.
Unconditionally compile ImageDecoder_S3TC.cpp.
Ubuntu 17.04's gcc doesn't seem to handle LTO properly for some reason.
It crashes when compiling Qt5 automoc files.
- gcc: 6.3.0-12ubuntu2
- qtbase5-dev-tools: 5.7.1+dfsg-2ubuntu4~1
Mostly based on xfce's tumbler:
https://github.com/xfce-mirror/tumbler
Instead of exporting the RpThumbnail object directly, a skeleton object
created using gdbus-codegen is exported. The server-side object has
signals that map to the D-Bus methods.
RpThumbnail no longer has signals that map directly to the D-Bus object.
Instead, it calls functions in the skeleton object, which export the
signals.
Unfortunately, the file size has increased a bit. (TODO measure file
sizes in debug and release.)
FindGLib2.cmake: We need gio-unix for the gdbus-codegen generated files.
Import it in GLib2::glib so we don't have to link to it manually in the
rp-thumbnail-dbus project. (TODO: Make this a GIO library target instead
when doing the main commit)
TODO:
- Split the RpThumbnail object from the main code.
- Move rp-thumbnail-dbus out of the xfce directory?
Release build sizes: (MSVC 2017)
- rom-properties.dll: 655,360 -> 676,864 (+21,504 bytes)
- rpcli.exe: 480,768 -> 496,128 (+15,360 bytes)
It's not that much overhead, so I'll keep it enabled for all builds.
The manifest files are now .in files. They have replacement tags for
the `version` and `processorArchitecture` fields, which are filled in
by CMake's CONFIGURE_FILE() at configure time.
This will ensure that I don't forget to update the manifest version
numbers before release (which I did for rpcli in v1.0).
[cmake] win32.cmake: Set WIN32_MANIFEST_PROCESSOR_ARCHITECTURE to the
correct value for the manifest's `processorArchitecture` field.
Reference: https://opensource.apple.com/source/Libc/Libc-1044.1.2/string/FreeBSD/memmem.c
[cmake] gcc.cmake: -D_GNU_SOURCE=1 is required for memmem().
Interestingly, it seems to work fine in C++ code without this, but it
doesn't work in C code, and cmake compiles as C when checking for the
existence of memmem(). (CheckSymbolExists)
FIXME: Running CMake with -DENABLE_LTO=ON, then -DENABLE_LTO=OFF
doesn't seem to work right... (The flags aren't removed properly.)
[Kubuntu 17.04, cmake-3.7.2]
- _crt: If "static", use the static CRT. Otherwise, use the DLL CRT.
- Other parameters for specifying the configuration. If not specified,
applies to all configurations.
[svrplus] Only use the static CRT in the various Release builds.
TODO: We aren't using MinSizeRel or RelWithDebInfo right now.
Maybe we should...
Rebased CMakeLists.txt on the original TinyXML2 CMakeLists.txt,
but with lots of stuff disabled and some changes.
- Disable installation of everything except the DLL.
- Disable testing.
- Set TINYXML2_IMPORT as an interface definition when building
as a DLL.
- Remove TINYXML2_EXPORT in the static library build, which didn't
work anyway due to a typo.
- Added a debug postfix for debug DLLs.
- Disabled MSVC configuration that's alread yset in the platform
configuration.
- Added other MSVC options, including split debug settings.
- win32-gcc.cmake: Enable the "secure" API functions: *_s()
- FIXME: May not work on XP with MinGW's implementation, since it
uses MSVCRT.DLL.
- c99-compat.msvcrt.h: Don't redefine some functions on MinGW,
since gcc complains about missing dllimport attributes It also
causes problems with C++ namespace imports.
C4013 occurs in C code if an undefined function is referenced. This is
technically not an error in C, but it is in C++, so I'm forcing it to
be an error in order to prevent linker errors later on.
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)
CMakeLists.txt: Use the top-level CMake directories.
cmake/platform/win32*.cmake: Define the Windows SDK version in
win32.cmake. Use the same version (Windows XP) regardless of
the target operating system in order to keep everything consistent.
[libpng] CMakeLists.txt: Fix MSVC debug paths for png_static.
There were several issues caused by travis-ci using cmake-3.2.2
instead of what I have locally, cmake-3.7.2:
- FIND_PACKAGE(PkgConfig) sets PKG_CONFIG_FOUND, not PkgConfig_FOUND.
- Set cache internal variables instead of parent scope. (Probably not
needed, but it's a good idea.)
- Older PkgConfig CMake modules don't support PKG_GET_VARIABLE(), so use
defaults for Nautilus and Thunar extension directories in that case.
- Added diagnostic messages for older PkgConfig.
- Print the cmake version in travis-ci.
Squashed commit of the bugfix/travis-ci-gtk branch.
- Always use Windows XP (0x0501) for the SDK OS version.
- Check CMAKE_CL_64 for 64-bit MSVC.
- Use subsystem 5.02 (2003) for 64-bit and 5.01 (XP) for 32-bit.
MinGW-w64 only links in libssp if a function needs stack protection.
Since my toolchain doesn't have libssp enabled, this results in the
previous check passing (-fstack-protector-strong with a nearly empty
test program does nothing), but other tests end up failing because
libssp isn't available.
Use a test program with varargs, based on the C99 vsnprintf() wrapper
for older versions of MSVC.
Using MinGW-w64 4.0.6 with gcc-6.2.0.
Note that it still doesn't compile successfully due to missing
functionality in MinGW-w64 4.0.6. I'll try it again with 5.0.1 later.
Note that MinGW-w64 5.0.1 is still missing isolation-aware functionality,
so it won't be able to handle XP theming correctly.
Summary of changes:
- cmake/platform.cmake: MinGW-w64 uses separate crt*.o files for Unicode
instead of a separate entry point. Handle this by removing the "w" from
the Unicode entry point and passing the "-municode" option instead.
- libpng, rpcli, win32: CMake-3.7.2 doesn't add include paths to windres.
Add the include paths manually in order to fix .rc compilation.
- c++11-compat.h: Moved the case-insensitive string comparison macros
from c++11-compat.msvc.h. MinGW-w64 doesn't have the wcs*() functions,
but it does have macros for str*(), so we have to define the macros
only if said macros don't already exist.
- [libcachemgr] CacheManager: gettimeofday() is in time.h on MSVC,
and sys/time.h on MinGW-w64 and other platforms. sys/types.h is
no longer needed.
libromdata:
- RpWin32.cpp: Added more conditionals to the error list in order to
fix compilation with MinGW-w64.
- RpWin32.hpp: Use reinterpret_cast<> for the atomic memory access
functions.
rpcli:
- time_r.h: #define _POSIX_C_SOURCE is required on MinGW-w64 in order
to use the *_r() functions.
- properties.cpp: #include "time_r.h" earlier to prevent time.h from
being included before _POSIX_C_SOURCE is defined.
win32:
- QITab.h: Split the QISearch() defines out of RP_ComBase.h and added
definitions that are missing on MinGW-w64.
- Added an extra '0' in QITAB instances in order to suppress gcc's
"missing initializer" warning. [-Wmissing-field-initializers]
- Moved all COM smart pointers to the top of the file. Disabled some of
them in MSVC builds because they're already defined in comdefsp.h.
- rom-properties.def: Removed the comment and "LIBRARY" statement, since
GNU ld doesn't recognize them.
This partially fixes#50. (Add support for multiple image sizes.)
Multiple image sizes are now supported for external image databases, but
not for internal images. This will need to be added for EXE icons, and
possibly also Nintendo 3DS icons (48x48 and 24x24).
The internal version of libjpeg-turbo currently only builds on Windows.
(The bundled CMakeLists.txt is Windows only.)
All example and demo executables have been disabled, and the autoconf
build system has been removed. The only target that builds now is
jpeg62.dll.
Currently supports RGB, YCbCr, and grayscale images. (YCbCr is handled
using libjpeg's built-in colorspace conversion.)
NOTE: libjpeg's RGB support outputs 24-bit RGB, so we have to manually
expand it to 32-bit ARGB with an opaque alpha channel.
Tested with Nintendo DS cover art and it works:
- ASME (Super Mario 64 DS) (RGB)
- BXSE (Sonic Colors) (YCbCr)
I manually converted the images to grayscale and those worked as well.
TODO: CMYK/YCCK. (libjpeg has automatic YCCK->CMYK colorspace conversion,
but not CMYK->RGB.)
[cmake] Added libjpeg detection and options.
TODO:
- Add an internal copy of libjpeg-turbo.
- Make libjpeg support optional?
This is needed because the entry point must be specified manually when
building with MinGW with ASLR enabled.
The entry point should be wmain for Unicode console applications,
so we need to specify wmainCRTStartup instead of mainCRTStartup.
[rpcli] SET_WINDOWS_ENTRYPOINT(rpcli wmain)
Supported by MSVC 2005, MinGW-w64, 64-bit glibc, and 64-bit Mac OS X.
glibc is working on adding 64-bit time_t for 32-bit software.
Support for that has been added using -D_TIME_BITS=64.
32-bit Mac OS X doesn't, and won't, support 64-bit time_t.
References:
- https://lwn.net/Articles/715242/
- https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
The existing functions are now marked as deprecated. They will be
preserved until the new functions are added and all RomData subclasses
have been updated to use them.
common.h: New DEPRECATED macro for gcc and MSVC.
msvc.cmake: Work around /sdl setting C4996 (use of a deprecated function)
as an error.
MSVC 2015 explicitly rejects /TSAWARE for DLLs.
win32-gcc.cmake: I'm not sure if --tsaware is rejected here,
but let's not set it for DLLs just to be sure.
It isn't usable yet, but the infrastructure is there.
FindDBusGLib.cmake: FIND_PACKAGE() file for dbus-glib.
org.freedesktop.thumbnails.SpecializedThumbnailer1.xml: Specification
for the SpecializedThumbnailer1 interface.
- Reference: https://wiki.gnome.org/DraftSpecs/ThumbnailerSpec
This is needed for the upcoming XFCE D-Bus thumbnailer.
FindGLib2: Renamed the target to GLib2::glib.
[gtk] Updated projects to link to GLib2::gobject and GLib2::glib.
GNOME still uses standalone executables, so we can just make a wrapper
around the shared library. XFCE uses the Tumbler D-Bus service, so that
will be more complicated.
DirInstallPaths.cmake: Added libexec and make use of the default
GNU installation directories.
config.version.h.in: Added more CMake variables.
Rewrote FindGLib2, FindGTK3, FindGdkPixbuf2, FindLibNautilusExtension,
and FindThunarX2 to use FIND_LIBRARY_PKG_CONFIG().
Fixed CFLAGS_OTHER on ThunarX2. (Incorrect capitalization.)
- Detect the ThunarX2 package version.
- Handle multiple include paths from CFLAGS.
- Make sure GLib2 and GdkPixbuf2 are available.
- Minor adjustments to the C code formatting.
Renamed the variables to match the case of the filenames, since CMake's
version detection requires this.
Set some preliminary defaults for GLib2, GTK3, and LibNautilusExtension.
TODO: Require the correct major version?
The Nautilus frontend is very similar to the Thunar (XFCE) frontend,
though some things have changed due to the different ways Nautilus
handles things. In particular, RomPropertiesPage is not a subclass
of NautilusPropertyPage; instead, RomPropertiesPage is added to a
generic NautilusPropertyPage as a widget.
Added Find*.cmake files for glib2, GTK+ 3, GdkPixbuf2, and
libnautilus-extension.
RomDataView: Set the GtkBox orientation to vertical when compiling with
GTK+ 3.x.
No ROM data parsing is implemented yet. All of this boilerplate is merely
to get a basic properties page plugin built and registered.
[cmake] FindThunarX2.cmake: CMake FIND_PACKAGE() file to find the GTK+2
ThunarX libraries.
[cmake] options.cmake: Added BUILD_XFCE.
This causes zlib, libpng, and possibly others to not export any symbols
in either the .a or .so on Linux, which makes them unusable.
CheckHiddenVisibility.cmake: New macro CHECK_HIDDEN_VISIBILITY().
Use this in the upper-level source directory to apply hidden visibility
to all subprojects. Used in src/CMakeLists.txt.
SetMSVCDebugPath.cmake: Add PREFIX and POSTFIX even if OUTPUT_NAME
is set, since libpng sets PREFIX to "lib" for consistency with other
operating systems. (Both set POSTFIX to "d" in debug builds.)
Since we're using architecture-specific directories now, we don't
need to suffix the DLL.
SetMSVCDebugPath: Fix handling debug paths if OUTPUT_NAME isn't set.
platform.cmake: Removed SET_WINDOWS_TARGET_NAME_ARCH(), since it's
no longer used by anything.
I'll eventually make them delayload so they won't be loaded unless they're
actually needed.
Rearranged the build directory layout such that all binaries are located
in the top-level bin/ directory. This is needed in order for the test
suites to work, since they might depend on zlib and/or libpng.
NOTE: We have to use CACHE INTERNAL; otherwise, the KDE5 build ignores
the directory options. (Maybe this is why the KDE4 build always used
this directory layout in the first place?)
NOTE 2: On Windows, DLLs are copied to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY},
whereas on Linux, SOs are copied to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}.
Test images are now copied using a custom command, since the output
directory isn't easily determined at generate time. (It could be
the same as ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}, but msbuild uses
configuration-specific subdirectories.
TODO: Keep test images in a subdirectory. This will need adjustments in
the test suites to look in img/ first, then the current directory.
I've decided to get rid of the GDI+ PNG handling. It doesn't improve
anything performance-wise, adds coding overhead, and probably isn't
any faster than libpng.
GDI+ also doesn't support APNG. This version does.
NOTE: If I add APNG export, I'll need to use the included libpng
in Ubuntu builds, since Ubuntu still has libpng-1.2, and it's a
version that doesn't support APNG.
Reworked the bundled library system to be similar to the one in
mcrecover, but improved.
Added "-fpic -fPIC" to all extlib static libraries when building
for Linux systems. This is needed for libpng, but might not be
needed for other libraries; nevertheless, it should be set.
TODO: Use libpng in the Windows build. It's being linked in,
but it isn't actually being used for anything yet.
[libromdata] config.libromdata.h.in: Added HAVE_LAMBDA_AS_FUNCTION_POINTER.
RomDataFactory: Use this CMake macro instead of hard-coding specific MSVC versions.
This makes it easier for Windows users to find README.md
and LICENSE.
DirInstallPaths.cmake: New variable DIR_INSTALL_DOC_ROOT.
This points to "." on Windows, and DIR_INSTALL_DOC on all
other platforms.
Set ENABLE_COVERAGE=ON to enable code coverage testing.
After the build is finished, run 'make coverage' to run the unit tests
and generate a code coverage page in the ${CMAKE_BINARY_DIR}/coverage
directory.
Reference: https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
(commit 59f8ab8dded56b490dec388ac6ad449318de8779)
CMakeLists.txt:
- Moved the CMAKE_BUILD_TYPE check to before INCLUDE(CTest),
and capitalized the 'D' in "Debug", since CodeCoverage.cmake
checks for that.
gcc.cmake:
- Set the required CFLAGS. (These aren't checked for explicitly, since
they're basically present on all gcc since forever.)
- Link all targets to -lgcov.
- Create a 'coverage' target for automatically running tests and
generating HTML output using lcov/genhtml.
options.cmake:
- Added ENABLE_COVERAGE.
scripts/lcov.sh:
- Shell script used by the 'coverage' target to generate the lcov/genhtml
output from the gcov profiling data.
CMakeLists.txt:
- Set the version to 0.7.99+.
- Added more CPack fields.
- Added an architecture-specific suffix for Windows packages.
(TODO: Package both 32-bit and 64-bit DLLs in the Win64 package.)
DirInstallPaths.cmake: Copied from GCN MemCard Recover, with some
changes to accomodate the different setup for rom-properties.
options.cmake: s/debug file/debug files/g
doc/, scripts/: Install the relevant files. Note that the files aren't
converted to Windows line endings when compiling for Windows.
[win32] CMakeLists.txt: Added INSTALL() commands.
platform.cmake: New function SET_WINDOWS_TARGET_NAME_ARCH().
This function determines the system architecture and appends
it to the specified target's OUTPUT_NAME.
"/sdl" was added in MSVC 2012 and can help reduce security issues.
Reference: https://msdn.microsoft.com/en-us/library/jj161081.aspx
[libromdata/tests] GcnFstTest.cpp: Fixed uninitialized variable errors
caught by the "/sdl" option.
C4482 warns about a non-standard extension for enum classes. Specifically,
it complains about "Gdiplus::Status::Ok". This form is recommended by
MSDN, and MSVC 2015 doesn't complain about it. It's also officially
supported by C++ 2011 as part of enum classes.
MSVC 2010, on the other hand, keeps complaining whenever it encounters
this kind of enum usage, so disable the warning to shut it up.
Example warning:
..\..\..\src\libromdata\img\GdiplusHelper.cpp(47): warning C4482: nonstandard extension used: enum 'Gdiplus::Status' used in qualified name [Z:\programming\rom-properties\build.vc10-msbuild\src\libromdata\romdata8.vcxproj]
msvc.cmake: Specify MASM flags "/W0 /safeseh". This fixes the 32-bit masm
build when using MSBUILD with MSVC 2015. 64-bit wasn't affected, though
we're setting it for all MSVC platforms.
The rp_image_backend for GDI+ hasn't been implemented yet, but it's good
enough to merge back into master.
This fixes:
- #3: Use pngcheck to verify downloaded PNG images.
This partially fixes:
- #4: rp_image subclasses with factory class
Conflicts:
cmake/platform/gcc.cmake
cmake/platform/msvc.cmake
src/libromdata/CMakeLists.txt
src/libromdata/file/IRpFile.hpp
We're going to use dynamic_cast<> for rp_image_backend, so RTTI needs
to be enabled. Otherwise, things will go haywire at runtime.
Also, removed the commented-out RTTI lines from gcc.cmake, since we're
not going to be reenabling it. (It was disabled for gcc builds because
KDE's thumbnail.so uses it for ThumbCreator subclasses.)
This fixes#7.
Five days of work, two encryption libraries, and a ton of custom formats,
all for a single field in the GameCube properties page. \o/
[libromdata/tests] CMakeLists.txt: Change ${GTEST_LIBRARY} to gtest.
This was done upstream, but AesCipherTest was still using the variable,
which no longer exists.
Conflicts:
src/libromdata/GameCube.cpp
src/libromdata/tests/CMakeLists.txt
libromdata/tests/CMakeLists.txt:
- Link to gtest directly instead of ${GTEST_LIBRARY}.
- Removed INCLUDE_DIRECTORIES() for googletest, since it's added to
TARGET_INCLUDE_DIRECTORIES() by googletest's CMakeLists.txt.
extlib/googletest/googletest/CMakeLists.txt:
- Uncommented gtest_hide_internal_symbols.
Removed cmake/gtest.cmake, since it doesn't have anything useful other
than INCLUDE(CTest), which is now present in the top-level CMakeLists.txt.
MSVC 2002 introduced the /GS flag, and it's enabled by default as of
MSVC 2005. Added a check for 2002/2003, even though those versions
definitely aren't supported.
gcc added -fstack-protector and -fstack-protector-all in gcc-4.1,
and -fstack-protector-strong in gcc-4.9. Prefer strong if it's available,
then fall back to -fstack-protector-all then -fstack-protector if
strong isn't available.
FIXME: Add support for the older nettle-2.x API, since Ubuntu 14.04
still has nettle-2.7.1.
cmake/modules/FindNettle.cmake: CMake module to find Nettle.
Reference: 9fe71b1d77/cmake/FindNettle.cmake
FIXME: If ENABLE_DECRYPTION is enabled, and Nettle can't be found,
the build will fail. Maybe show a message advising the user to
set -DENABLE_DECRYPTION=0?
crypto/AesCipher.hpp: New interface for AES ciphers.
crypto/AesCipher_CAPI.cpp: Windows CAPI implementation.
Currently supports ECB and CBC chaining modes.
GameCube: Create a WiiPartition object for the update partition.
This isn't currently used, but it will eventually be used to determine
the System Update version, if the update partition is present.
config.libromdata.h.in: Added #define ENABLE_DECRYPTION 1.
gcn_structs.h: Added Wii ticket and partition header structs.
Also added a uint34_rshift2_t typedef for values that are actually
34-bit but stored as a uint32_t, since the lower 2 bits aren't
significant.
cmake/platform/win32-*.cmake: Increase the minimum Windows version to
5.01 (Windows XP), since the AES provider was added in XP.
WiiPartition TODO:
- Share the AesCipher objects with a reference counter.
- Don't initialize AesCipher in the constructor, since we might
only want the partition header information.
AesCipher_CAPI TODO:
- Share the HCRYPTPROV with reference counting.
This class will be used to load encryption keys from the keys.conf file
in the user's configuration directory.
options.cmake: Added an option ENABLE_DECRYPTION. This is enabled by
default; if disabled, KeyManager won't be built, and decryption won't
be available for newer ROM and disc images that are either fully
encrypted or have encrypted sections.
platform.cmake: Call CHECK_LARGE_FILE_SUPPORT(). Note that LFS is
required due to the size of Wii disc images, so if LFS isn't
available, CMake will fail with an error message.
c99-compat.msvcrt.h: #define fseeko() and ftello() to the MSVC
non-standard _fseeki64() and _ftelli64() functions. This was in
Gens/GS II's libcompat/W32U, but I'm not using W32U here.
RpFile_stdio.cpp: Use fseeko() and ftello().
This fixes issue #2.
In addition to reworking RpImage to use libpng and/or GDI+ directly,
this branch adds AppVeyor support for Windows CI. This required
fixing the build system to work with CMake's Visual Studio project
generator, which uses msbuild instead of nmake.
Conflicts:
.travis.yml
CMakeLists.txt
This adds "/MANIFEST:NO" to an individual target. This allows us to use
MSVC's automatic manifest generation for unit tests, while also enabling
custom manifests for the actual rom-properties.dll project.
msvc.cmake: Removed "/MANIFEST:NO" from the default CFLAGS.
[win32] CMakeLists.txt: Use SET_WINDOWS_NO_MANIFEST().
Only CL explicitly requires /nologo to be lowercase. The rest of them
are supported better by CMake if they're uppercase.
CMake's MSBUILD generator was already adding /NOLOGO to RC, so adding
it again caused RC to go crazy and think that we specified "-ologo".
Also disabled /NOLOGO for MASM, just in case.
With nmake, CMake's default /SUBSYSTEM is added after our linker flags.
With msbuild, it's added before, which caused console programs like
RpImageLoaderTest to be linked as /SUBSYSTEM:WINDOWS, which failed
due to no WinMain() function.
AppVeyor, a Windows-based CI service, mostly (only?) works with
msbuild instead of nmake, so I need to get everything working.
TODO: /MANIFEST:NO is causing problems with programs that don't have
a manifest resource (RpImageLoaderTest), and RC isn't accepting the
-nologo option for some reason.
Notable changes:
- win32-msvc.cmake: Set RP_LINKER_FLAGS_${_subsystem}_EXE. This variable
is used by a new function to add to target-specific LINK_FLAGS.
- platform.cmake: New function SET_WINDOWS_SUBSYSTEM. This adds the
relevant linker flags. Note that it's only used for MSVC.
- Added SET_WINDOWS_SUBSYSTEM() to all EXE and DLL projects. Note that
the WIN32 flag is not available in ADD_LIBRARY(), so we're not setting
it for the Win32 rom-properties.dll.
- [win32] Append to the target LINK_FLAGS instead of resetting it.
Otherwise, we lose the /SUBSYSTEM flag.
The reason why this didn't work before is because generator expressions
are unknown at configure time; they're expanded when compiling.
Hence, attempting to split pathname components didn't work.
We can use the generator expression TARGET_FILE_DIR to get the target's
directory instead of manually splitting pathname components. This should
work on CMake 2.8.x, and it gets rid of policy CMP0026 warnings on
CMake 3.0 and later.
Removed the manual CFLAG testing from platform/gcc.cmake.
Other required changes:
- Removed CMAKE_MINIMUM_REQUIRED() from everything except the
top-level CMakeLists.txt. This interfered with setting the
CMake policy, since each invocation reset the policies to
match the specified minimum version.
- Added NO_POLICY_SCOPE to the cmake/platform.cmake include
in order to allow policy changes within platform.cmake to
propagate to the rest of the project.
This is only needed when enabling ASLR on EXEs due to a bug in GNU ld.
DLLs are always compiled with relocation information, and they don't
have an entry point in the sense of an EXE entry point.
Older MinGW (gcc-4.5.2) now mostly compiles rom-properties.dll, but its
w32api implementation is missing lots of stuff, including IExtractImage.
Changes:
- CheckCXX11CompilerFlag.cmake: Check for static_assert(), not nullptr.
nullptr was added in gcc-4.6, while static_assert() was added in
gcc-4.3.
- stdafx.h: Removed #include <comdef.h>. This header provides some
COM utility classes that we aren't using.
- uvector.h: Added checks for gcc functionality.
- [libromdata] #include <stdlib.h> for free().
We're linking the DLLs and SOs as "MODULE", since they're always loaded
as plugins instead of directly linked into applications. Hence, we need
to set CMAKE_MODULE_LINKER_FLAGS in order to get linker flags to apply
to the modules.
This fixes an issue where "/manifest:no" wasn't being passed to MSVC's
linker, which caused a conflict when adding an isolation-aware manifest
file in order to properly support theming on Windows XP: (MSVC 2010)
CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:2, language:0x0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
LINK Pass 1 failed. with 1105
RP_ComBase.hpp: MinGW-w64 does actually provide overloads for the atomic
functions, but only if _WIN32_WINNT >= 0x0502, which is set in the 64-bit
version but not the 32-bit version. Disable our overloads for the 32-bit
build, since we're still supporting 32-bit XP (0x0501).
Added file header comments to RP_ComBase.hpp and RP_ClassFactory.hpp.
KDE's kio_thumbnail.so uses RTTI for ThumbCreator, since that isn't
a QObject. Disabling RTTI completely breaks thumbnailing.
I'm leaving RTTI disabled in the MSVC build for now, since the Windows
equivalent uses COM, not RTTI.
The disc header is read, and some basic information is displayed.
The company code is decoded and looked up using a hard-coded list
of company codes from GameTDB:
- http://www.gametdb.com/Wii
- http://www.gametdb.com/Wii/Downloads
gcc.cmake: Added -Wno-multichar, since I'm using multi-character
constants in NintendoPublishers::ms_thirdPartyList[].
- options.cmake, src/CMakeLists.txt: Only attempt to build the
KDE4 and KDE5 plugins on Unix/Linux systems.
- TextFuncs:
- Fixed various wchar_t/char16_t issues.
- Implemented cp1252 fallback for Windows in cp1252_sjis_to_rp_string().
The W32U_mbs_to_UTF16() function now has a dwFlags parameter, which
is used by cp1252_sjis_to_rp_string() to ensure it fails if the string
contains invalid Shift-JIS sequences. (MB_ERR_INVALID_CHARS)
- Renamed 'n' variables to 'len'.
Split RomPropertiesDialogPluginFactory into separate files. Note that
separate files are needed for KDE4 and KDE5 due to changes in automoc.
automoc4 complains if it has an #include for .moc, whereas automoc5
doesn't recognize that K_PLUGIN_FACTORY() has a Q_OBJECT macro, so it
fails to link due to undefined references to a vtable.
cmake/options.cmake: Added BUILD_KDE4 and BUILD_KDE5 options.
Both default to ON, but if the dependencies are missing, then their
respective plugins won't be built.
KDE4_ADD_PLUGIN() builds the library in build/lib/ instead of
build/src/kde/, so objcopy couldn't find the .debug file.
Note that objcopy only embeds the filename portion, not the full path,
so this won't cause any problems when debugging.
Minor change in SplitDebugInformation to handle CMake linking the
shared library in build/lib/ instead of build/src/kde/.
Added options for SPLIT_DEBUG and INSTALL_DEBUG, though INSTALL_DEBUG
isn't currently used.
Some stuff was stripped out, including support for ANSI Windows.
The minimum version I'm officially going to support once I add
Windows support is XP, though 2000 might "just work".