Check for the commonly used CMake variable `ENABLE_SHARED` and set
`VBAM_STATIC` accordingly if it is set.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix the CMake compile check for SDL_SCALEMODE_PIXELART to use
CheckSourceCompiles instead of CheckSymbolExists which does not work for
this purpose.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix finding static vcpkg x265 when it is named `x265-static.lib` as it
is right now.
Fix finding vcpkg host pkgconf on ARM64 Windows, which uses x64 host
binaries.
Remove build environment architecture check, which fails building x64 on
ARM64. That whole file needs to be rewritten to use the compiler target
architecture.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Optimize the `find_wx_util` function to try the major and minor version
parsed from the lib file first, avoiding a very slow exhaustive search
of possible version numbers.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Try to set the architecture correctly when compiling for Intel on ARM64
Macs, this also sets the zip name correctly for our releases.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix re-installing binary packages on next cached run by clearing the
cache entries for `vcpkg list`. Also remove the binary packages
directory after installing.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Set the CMake cache variables for `vcpkg list` in `CACHE` instead of
`PARENT_SCOPE`, because the parent scope is now a transient function and
nothing was being cached, causing very slow run speed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Keep a list of already installed dependencies and use the count to
determine if any are not installed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Followup on 357eccc6 (build: fix checking if bin pkg host deps
installed, 2025-07-13) keep a count of already installed host deps, and
when the host deps count is equal to it rather than zero, break out of
the loop. This fixes the infinite loop and hang caused by host deps
being required but already being installed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix the check for host dependency packages being downloaded to not run
if the package is already installed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Don't set the compilers to `gcc` for MinGW vcpkg triplets, because it
may be CLANG64 with MinGW.
Link FAudio using the `-static` target or the normal target only.
Use `ghc::filesystem::path::c_str()` to pass paths to `std::fstream` as
there is a conversion problem with this toolchain.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Before installing calculated host dependencies for binary packages,
check if they are already installed.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Remove our copy of FindFFmpeg.cmake, as this module is included in
distributions now.
This also fixes the problem with finding x264 and x265 components and
libraries for FFmpeg.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add CMake option VCPKG_BINARY_PACKAGES, defaulting to TRUE to download
and use binary packages for vcpkg dependencies.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use the `vcpkg-binpkg-prototype` `vcpkg-list` implementation and never
`vcpkg list`, because the letter sometimes shortens package names and
may be breaking the package installed check.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Calculate and install only build dependencies for a binary package set
instead of everything from the host triplet. This way we can support
binary packages for dynamic builds as well.
Also check that the vcpkg Git clone is writable if it does not exist.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Always use a parallel vcpkg directory instead of the Visual Studio
default vcpkg, because installing there requires elevation and doesn't
always work.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add the CMake option `ENABLE_OPENAL` which defaults to `ON` except for
32 bit Windows builds, because OpenAL-Soft uses `avrt.dll` which is not
available on Windows XP.
Update README.md.
Fix linking `libsamplerate` for the `x86-mingw-static` triplet which we
use for 32 bit Windows XP builds.
Make some minor fixes to SDL3 detection and SDL2 fallback.
Clean up the audio API selection code paths.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix x86 32 bit build for Windows XP.
Set the `WINVER` and `_WIN32_WINNT` macros to the value for Windows XP.
Disable XAudio for these builds.
Add the missing `inet_pton()` and `inet_ntop()` functions for SFML.
Fix a FetchContent warning in the CMake as well.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Default `ENABLE_SDL3` to whether `find_package(SDL3)` can find it.
Only add libsamplerate for SDL2 with vcpkg.
Install gettext tools on Windows if they are not available, not just
under MSVC. This makes the `x86-mingw-static` triplet work as well.
Fix syntax error.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>