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>
When using vcpkg as the toolchain, pass NO_DEFAULT_PATH to
find_package(wxWidgets ...) so that the default cmake
FindwxWidgets.cmake is not included.
Set wxWidgets_DIR to the
<vcpkg-root>/installed/<triplet>/share/wxwidgets vcpkg port directory
for the subsequent find_package() calls to find the port-installed
wxWidgetsConfig.cmake file.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Apple compiler ID is defined as `AppleClang`. Rather than explicitly
adding every single compiler ID, this changes the build to try to apply
settings for GCC for every non-MSVC-like compilers.
* Bring the wx frontend more in-line with the rest of the codebase.
* Always default to Unicode APIs on Windows.
* Clean up all include guards and headers.
* Create multiple components library. These depend on the core code and
are used by multiple frontends.
* Clean up the filters declaration by moving them to a common header in
`components/filters/filters.h`.
* Clean up the include guards and include orders.
* Fix the modified paths in `src/debian/copyright` to match their new
location.
* Move src/apu/, src/gb/ and src/gba/ to src/core/.
* Clean up include guards and headers.
* Rename `BKPT_SUPPORT` to `VBAM_ENABLE_DEBUGGER` and remove the
`NO_DEBUGGER` define.
* Clean out all of the dependent headers.
* Modify generated version.h to improve the dependency chain and isolate
the generated file to its own sub-directory within the build
directory.
* Remove duplicate function definitions between the libretro and other
frontends by merging them into a common source file.
* Also move `systemMessage()` and message IDs definitions to core/base.
* Clean up and modernize many file utility methods.
* Clean up source set and public headers.
* Make the fex library an OBJECT library to speed up build.
* Clean up the only fex include to use the full path to the header.
CMake 3.25 introduced the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to set the
/Z flag for MSVC toolchains. Use it rather than modifying the compile
options if possible. We revert to setting the compile options manually
if the CMake version is too old.
* Use add_compile_definitions everywhere.
* Remove unused intermediate target.
* Add ASAN support for MSVC.
* Remove duplicate option definitions.
* Configure MinGW separately from the toolchain
* Move toolchain-specific options to their own files.
* Clean up and modernize the use of toolchain options.
* Use modern cmake LTO support.
* Remove dead cmake code and cmake functions available in upstream cmake.
* Update README.md to remove references to removed build options.
Add llvmPackages_latest.clang and bintools to the macOS part of
default.nix for nix, because for some reason the `ar` utility is not
found in GitHub actions right now.
Disable LTO for the macOS action for now, this is a consequence of
recent cmake refactoring and needs to be fixed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This moves all build options to their own file to clean up the main
CMakeLists.txt. In addition, this upgrades the minimum required CMake
version and changes the build to use CMAKE_MSVC_RUNTIME_LIBRARY rather
than hardcoding the MSVC ABI flag.
SDL2 now comes with a cmake find_package() module, so we will use it
instead of this one that came from someone's github a decade ago.
Keep the fixup for libsamplerate with vcpkg and move it into the main
cmake code.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add clang when installing for CLANG* environments in MSYS2 because this
package is no longer included by default in the set of packages we
install.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
In preparation for including the finished FAudio support, link the cmake
FAudio target FAudio::FAudio when the feature is enabled.
Add pthreads to vcpkg deps and use the installed PThreads4W on Windows.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>