Commit Graph

21 Commits

Author SHA1 Message Date
David Korth
43b9691078 [cmake] 64BitTimeSupportFcntl.cpp: This file was missing...
Copied it from rom-properties.

This broke the Launchpad Ubuntu 20.04 armhf build. Not going to resubmit
it, because I don't think anyone will be using rvthtool on that OS and
platform...

(cherry picked from commit d9f4ec96f1)
2025-06-17 00:43:32 -04:00
David Korth
27ba56c693 [cmake] Backport more changes from rom-properties.
Changes include:
- Add RelWithDebugInfo flags.
- Add NixOS handling.
- Add ENABLE_WERROR.
- Add more warning flags.
- Add "-fprofile-update=atomic" for code coverage.
- Fix DT_RELR.
- Enable C++ assertions for libstdc++ and libc++.
2025-05-21 18:14:39 -04:00
David Korth
736d626554 [cmake] CPUInstructionSetFlags.cmake: PowerPC should set CPU_ppc64 or CPU_ppc, *not* CPU_arm64 or CPU_arm.
Copy/paste error. Oops.

(copied over from rom-properties)
2024-04-26 21:30:17 -04:00
David Korth
eec1d68907 [cmake] Check64BitTimeSupport.cmake: Don't set TMP_TIME64_FOUND_TIME_BITS if C++ support is broken.
Not sure how I didn't notice this before... (probably because
I don't regularly test the 32-bit i386 version, and Ubuntu
didn't ship glibc-2.34 in any LTS releases.)

(copied over from rom-properties)
2024-04-26 21:29:20 -04:00
David Korth
e3f6c26281 [cmake] SplitDebugInformation.cmake: Add --strip-all to the second objcopy command.
Combining the removal of .gnu_debuglink into the objcopy command had the
effect of losing `strip`'s usual stripping functionality. Add the
`--strip-all` parameter to restore it.

Copied over from rom-properties.

This fixes a regression from commit 43372103cb.
(Port over CMake changes from rom-properties.)
2024-02-20 23:44:36 -05:00
David Korth
43372103cb Port over CMake changes from rom-properties.
- CPUInstructionSetFlags.cmake: Add more CPU architectures.

- DirInstallPaths.cmake: Set ${TARGET_CPU_ARCH} and add more
  CPU architectures.

- FindNETTLE.cmake: Use ${TARGET_CPU_ARCH}.

- SplitDebugInformation.cmake: Add the `mold` workaround.

- options.cmake: Disable split debug by default on macOS.

- platform.cmake: Minor cleanups.

- gcc.cmake: Code coverage cleanup, check for "--no-undefined" and
  "--no-allow-shlib-undefined" (but only allow them on Linux),
  and check for "-ftree-vectorize".

- msvc.cmake:
  - Add: /we4477 /MP /guard:cf /guard:ehcont /permissive-
  - On i386 only: /SAFESEH
  - Disable /Zc:externC /Zc:noexceptTypes on Clang.
  - Disable thread-safe statics only on i386 and amd64.

- win32-gcc.cmake, win32-msvc.cmake:
  - Various flag changes.
2023-11-25 10:09:48 -05:00
David Korth
af560c4ee9 Use CMAKE_<LANG>_STANDARD instead of custom macros.
CMake 3.1 added CMAKE_<LANG>_STANDARD, which allows CMake to determine
what flags are needed to select a particular language version.

Set it to C17 and C++17. Previously, we were using C11 and C++11,
though gcc11 switched the default C++ version to C++17. The custom
macro handled this by not adding flags for C++, but it still added
the C11 flag, which prevented use of C17.

Ported over from rom-properties.
2023-11-25 09:43:53 -05:00
David Korth
41977b819b [cmake] DirInstallPaths.cmake: Don't install to architecture-specific subdirectories.
This is needed for rom-properties, since we have to provide both
32-bit and 64-bit DLLs for proper shell integration, but rvthtool
is only packaged for a single architecture.
2022-08-07 18:02:01 -04:00
David Korth
9fcc17d6bf [qrvthtool] Add an AppStream metainfo XML.
Unlike rom-properties, this is only installed as part of qrvthtool.

The metainfo XML lists all of the installed executables, not just
qrvthtool.
2022-08-06 11:05:16 -04:00
David Korth
1a992e41ff [qrvthtool] CMakeLists.txt: Use macros for the XDG paths.
Rename the .desktop file to com.gerbilsoft.qrvthtool.desktop.

TODO: Maybe com.gerbilsoft.rvthtool.qrvthtool.desktop? Not that
I'd be making a GTK+ UI frontend anytime soon...
2022-08-03 18:44:01 -04:00
David Korth
67de549aff [cmake] Backported a lot of CMake changes from rom-properties. 2022-07-12 18:04:42 -04:00
David Korth
4e5d89ed35 Use reentrant time functions if available.
Copied the following from rom-properties:
- time_r.h
- config.libc.h.in
- CheckSymbolExistsOrInline.cmake
2022-02-14 21:36:32 -05:00
David Korth
6ca6180f43 Copied various CMake module updates from rom-properties.
- Changed several macros to functions, e.g. C/C++ language version checks.
- Improved CPU architecture detection.
- Improved LFS detection on some *BSD platforms.
- Preliminary support for Windows on ARM.
- Added toolchain files for i686 and x86_64 MinGW-w64.
2020-06-20 14:01:52 -04:00
David Korth
67c4bd045e [cmake] Copied CMake updates from rom-properties. 2019-12-30 13:10:03 -05:00
David Korth
6404db3781 [qrvthtool] Added LanguageMenu and TranslationManager.
Based on the same classes from mcrecover.

TODO:
- Add some translations.
- Persistent configuration. I don't think porting mcrecover's ConfigStore
  is the right thing to do here.
2018-09-30 21:24:22 -04:00
David Korth
7708203283 [cmake] DirInstallPaths.cmake: Added Mac OS X install paths. 2018-09-23 15:35:56 -04:00
David Korth
cb0cbbc692 Install documentation; remove architecture from Windows install paths.
The architecture was needed for rom-properties, but we're only going to
distribute single-arch ZIPs for rvthtool.
2018-04-25 23:23:13 -04:00
David Korth
1e55a7e508 [cmake] Check for C11 in addition to C99.
C11 has _Static_assert(), which is needed for ASSERT_STRUCT().
2018-02-17 21:21:19 -05:00
David Korth
184dbd8549 Added a precompiled build of mpir-3.0.0 for Windows. (32-bit and 64-bit)
CryptoAPI's RSA functionality is ridiculously complicated to use. Instead
of wasting time figuring out how to use it, we'll just precompile MPIR
(a mostly GMP-compatible library) and nettle for Windows.

This commit includes a precompiled build of mpir-3.0.0. rsaw_gmp.c works
with it with no problems. The Windows version is now significantly faster
at verifying signatures as a result.

Removed rsaw_generic.c, since it's no longer in use.
2018-01-26 22:10:54 -05:00
David Korth
f9fc1a0119 Reverted back to the CheckC99CompilerFlag and CheckCXX11CompilerFlag macro files.
c_std_99 was added in CMake 3.8, which is a fairly recent version.
Ubuntu 17.04 has CMake 3.9, but 16.10 has 3.7.2. Hence, we shouldn't
use it in order to remain compatible with at least Ubuntu 16.04 LTS.
2018-01-17 20:53:55 -05:00
David Korth
f321fe5e65 Initial import of RVT-H Tool.
This program will allow for managing Nintendo RVT-H Reader devkits,
including dumping existing images and installing new images.

The current version doesn't actually do anything. It's mostly a copy
of the infrastructure from rom-properties, with some changes. In
particular, we're using CMake's TARGET_COMPILE_FEATURES() instead of
manually detecting C99 support.
2018-01-15 06:58:54 -05:00