Copy the cmake 3.28.3 FindGettext.cmake to cmake/ and comment out the
line that updates the po file from the pot. Because we download po files
from transifex we don't want this.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add the NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM env var to the macOS CI as
faudio has not been marked compatible with macOS yet.
Remove FindGettext.cmake as it is a core cmake module that is available
in the versions of cmake we support now.
Add support for nix to MacPackageManagers.cmake and add brew gettext to
CMAKE_IGNORE_PATH when not using brew. Also update the cmake style.
Add faudio, libintl and the System framework to buildInputs in
default.nix.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Move setting up the environment for macOS Homebrew earlier in
Options.cmake, as well as finding pkgconfig.
Update gcc/clang toolchain to not pass a gcc-specific option to clang.
Add faudio to list of brew packages to get in installdeps.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update from the channels/channel_layout API to the new ch_layout API,
assume two channel stereo always.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Change the find_package() call for FAudio to QUIET to not show a giant
warning when it's not available.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Change Linux nix dependencies in default.nix for OpenGL from mesa to
libGL and libGLU, also fixing the compile error for the SDL binary.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
The CPSR register needs to be restored from SPSR when switching modes.
This is currently being done for all mode switches /except/ for FIQ,
which is very likely just an oversight rather than intended behaviour.
This fixes the random crashing in OpenLara, as well as fixing random
glitching of my own project that uses FIQ mode switches. The issue
happens "at random" because it requires an interrupt to occur while in
FIQ mode, and it must also fire inside a section of code that relies on
the status flags (or the CPSR register in general): When exiting the
interrupt exception, the CPSR register is supposed to be restored from
SPSR, but this isn't being done when switching from IRQ mode back to FIQ
mode, which results in CPSR (and thus the status flags) being corrupted.
For example, SUBS r0, #1; [interrupt]; BNE 1b would trigger the bug, but
[interrupt]; SUBS r0, #1; BNE 1b wouldn't, and neither would
SUBS r0,#1; BNE 1b; [interrupt].
Remove -lgcc from static link flags for gcc/clang, clang does not
support this and -static-libgcc is enough.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Update dists for gettext and gsed to get around new compile errors from
clang.
Update SDL and ffmpeg and add FAudio.
Make some other minor adjustments for recent changes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This removes remaining dependencies on Windows in the FAudio code by
removing the device notification code and switching to portable
`condition_variable` for the buffer end notification event.
This moves all of the audio code in the wx frontend to the
`src/wx/audio` folder and simplifies many call sites by having one
generic API to enumerate audio devices and create the audio driver.
In addition, this fixes many corner cases in device enumerations and
moves handling of the default device to the respective audio backends,
rather than pushing it to the UI.
Finally, this changes the `Sound/AudioDevice` setting to use the
underlying device ID, rather than the user-facing name.
Pass `/fd certHash /td certHash` to signtool as they are required
arguments.
signtool comes with Visual Studio and now works and we don't need to
require osslsigncode anymore.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Make the regular expression against VCPKG_ROOT less specific for
detecting the default Visual Studio vcpkg, for some reason it stopped
working.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Corrected the current FAudio output code, FAudio api wasn't
a direct 1 for 1 code replacement. Adjusted the existing
code structure so that FAudioVoiceCallBack struct
was being properly called on.
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
This fixes a number of issues with the current implementation. Namely,
some options were not properly saved and the audio driver was not
properly reloaded when some options were changed.
In addition, this moves most sound-related options to `g_owned_opts` and
simplifies many call sites.
Only pass -Werror=lto-type-mismatch to gcc, clang does not have this
option and throws a warning.
Also quote some barewords in if() statements.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
* Move CMake dependencies checkout to `cmake/Dependencies.cmake`.
* Disable most dependencies checkout from the `TRANSLATIONS_ONLY` build.
* Remove the debug/translations_only GitHub Action.
Add -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing to
compile and link options for gcc/clang always.
Rename struct yy_buffer_state in src/sdl/expr-lex.cpp to struct
yy_buffer_state_sdl because it breaks when linking the SDL binary with
-Werror=odr.
Fix#1260
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add a toggle for SDL GameController Mode in the game key configuration
dialog, default enabled.
On check or uncheck, change the option and reinitialize joysticks, not
using GameController mode if it is disabled.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add faudio to list of optional vcpkg deps linked to ENABLE_FAUDIO.
This codepath is not used right now as we are using binary packages.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Pass -Wno-deprecated-copy only for C++, gcc gives a warning for C.
Pass -Wno-unused-command-line-argument for clang only, gcc gives a
warning about it.
Add a failsafe for gcc/clang static link flags if libstdc++ or
libpthread is not available as a static library.
Move link command adjustment script invocations to src/wx, the target is
not yet defined in the toolchain.
Add -lws2_32 to the end of the link command for gcc on Windows because
of link order issues with those symbols.
Disable LTO for gcc on Windows, as it is broken.
Don't install extra-cmake-modules on MINGW32, that package is not
available there.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Bring back setting the MSYS variable under MSYS2, it's still being used
in a few places.
Link the SDL2::SDL2-static target for static builds.
Add -static-libgcc and -static-libstdc++ to the gcc/clang toolchain for
static builds.
Edit wxWidgets_LIBRARIES under MSYS2 to specify liblzma.a explicitly
because for some reason it's not being linked statically by default for
static builds.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>