Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
49b3773
RTC Improvements
Squall-Leonhart Nov 14, 2025
aa500b1
made a mistake with preserving bit 7
Squall-Leonhart Nov 14, 2025
6e61b5a
translations: transifex pull
rkitover Nov 14, 2025
25a5871
translations: transifex pull
rkitover Nov 15, 2025
1c71762
More stride/border fixes
rkitover Nov 16, 2025
322b68a
enhance super eagle to accept LCD filter on 32bpp/24bpp
Squall-Leonhart Nov 16, 2025
1f9e10f
translations: transifex pull
rkitover Nov 17, 2025
0b9480f
Change all video driver status msgs to err/dbg log
rkitover Nov 17, 2025
9235e5a
Add VSync support for SDL video
rkitover Nov 17, 2025
13db4f7
Implement VSync and Bilinear for Metal video
rkitover Nov 17, 2025
46b08fe
translations: rebuild source .pot
rkitover Nov 17, 2025
bf31992
translations: transifex pull
rkitover Nov 17, 2025
94fcde8
translations: transifex pull
rkitover Nov 17, 2025
32b5400
Fix color w/ filters at 8/16bpp and Super Eagle
rkitover Nov 17, 2025
1a2a677
translations: transifex pull
rkitover Nov 18, 2025
f7ef244
Fix `systemScreenMessage()` for scale and Unicode
rkitover Nov 18, 2025
8c2dc4d
Remove gbColorOption, the old GB color correction
rkitover Nov 18, 2025
43087a0
Fix warnings in 2xSaI.cpp
rkitover Nov 19, 2025
2910a6d
Fix unused variable warning in gb.cpp
rkitover Nov 19, 2025
f6a1714
build: use pwsh to zip on Windows when no zip
rkitover Nov 19, 2025
8a11a9f
build: adjust `zip.ps1` to work more like InfoZip
rkitover Nov 21, 2025
e82f04d
scale 5bit channels to 8bit
Squall-Leonhart Nov 26, 2025
0ec4c30
fix assert on soundreset() in debug builds
Squall-Leonhart Nov 26, 2025
81b7e3e
Restore menubar keyboard accelerators
rkitover Nov 27, 2025
34632df
Merge remote-tracking branch 'libretro/master'
rkitover Nov 27, 2025
4f35245
Allow emu system in directory config path parts
rkitover Nov 29, 2025
6836171
Expand system name acronyms in directory config
rkitover Nov 29, 2025
0648e76
Fix 8 second startup delay
rkitover Dec 1, 2025
17ce11a
Fix some issues with the FAudio driver
rkitover Dec 3, 2025
60f9d3a
build: check for FAudio SDL2/3 mismatch
rkitover Dec 3, 2025
08a7311
build: skip FAudio/SDL mismatch checks on WIN32
rkitover Dec 3, 2025
cfe4788
build: add FAudio to installdeps for Debian/Ubuntu
rkitover Dec 1, 2025
9c03b73
gb: fix enable SRAM check
rkitover Dec 3, 2025
8e9006e
gb: decau cart bus access outside ROM
rkitover Dec 3, 2025
c698425
Fix binding game keys in input config
rkitover Dec 3, 2025
0dce5c4
Fix some gcc warnings in Debug build
rkitover Dec 3, 2025
e25628a
Further improve Gtk menu appearance
rkitover Dec 3, 2025
62a6bf1
gb: use BIOS for emulated system
rkitover Nov 19, 2025
51bd71c
build: -j/-q to zip.ps1 for XRC, zip.bat to PATH
rkitover Dec 3, 2025
bb68658
libretro: remove `gbColorOption`
rkitover Dec 3, 2025
5193964
Fix warning on Linux
rkitover Dec 3, 2025
02145c1
build: compile `zip.ps1` to `zip.exe` on WIN32
rkitover Dec 3, 2025
4338554
Fix a couple of warnings for MSVC
rkitover Dec 3, 2025
0074d95
build: disable link for VS in CI until VS2026
rkitover Dec 3, 2025
0e04b03
build: nicer status message for `zip.ps1`
rkitover Dec 3, 2025
d51c6d4
gb: fix RTC > 512 days
Squall-Leonhart Dec 3, 2025
09c2597
gb: make joypad polling more accurate
rkitover Dec 4, 2025
b67413f
Implement L/R modifier support, game and shortcut
rkitover Dec 5, 2025
8eae153
Merge remote-tracking branch 'libretro/master' into libretro-merge
rkitover Dec 6, 2025
b251947
removed/improved commentary
Squall-Leonhart Dec 6, 2025
1ac9d02
gb: log writes to undefined RTC bits
rkitover Dec 6, 2025
2177aa0
Merge branch 'libretro-merge'
rkitover Dec 6, 2025
12f23f4
translations: rebuild source .pot
rkitover Dec 6, 2025
9dc6962
translations: transifex pull
rkitover Dec 6, 2025
c4b3641
build: fix PATH handling for wxrc/zip
rkitover Dec 7, 2025
ff3726d
Fix some warnings from libretro merge
rkitover Dec 7, 2025
f5464e5
build: fix occasional fails including GoogleTest
rkitover Dec 7, 2025
f744131
Fix keyboard modifier tests
rkitover Dec 7, 2025
ac33dda
translations: transifex pull
rkitover Dec 7, 2025
0d08bf5
translations: transifex pull
rkitover Dec 7, 2025
956a0f7
build: bundle ps12exe for zip.exe, faster CMake
rkitover Dec 7, 2025
506d4a0
build: use zsh as POSIX sh for Mac builder
rkitover Dec 7, 2025
58e3791
build: update Mac builder dists, fix jobs for zsh
rkitover Dec 7, 2025
19e3e0a
translations: transifex pull
rkitover Dec 8, 2025
03fadc7
Fix CTRL/CMD distinction on macOS and menu display
rkitover Dec 8, 2025
864c4e6
translations: rebuild source .pot
rkitover Dec 8, 2025
dde9b19
translations: transifex pull
rkitover Dec 8, 2025
6645d5e
translations: transifex pull
rkitover Dec 9, 2025
0d92612
Fix 2xSAI and Super 2xSAI
Squall-Leonhart Dec 9, 2025
339f119
Fix GBA RTC
Squall-Leonhart Dec 9, 2025
2fdd5da
Fix File->Close and Cheat List regressions
rkitover Dec 10, 2025
08ee50b
translations: transifex pull
rkitover Dec 10, 2025
d42c33d
translations: transifex pull
rkitover Dec 11, 2025
cb5f287
translations: transifex pull
rkitover Dec 11, 2025
80af15f
Improve appearance of OSD at native resolution
rkitover Dec 12, 2025
4433aba
Remove transparent OSD option, did nothing
rkitover Dec 12, 2025
b8cfdfe
Restore messages filter/inter-frame-blender cycle
rkitover Dec 12, 2025
6bb046b
translations: rebuild source .pot
rkitover Dec 12, 2025
5bf016b
translations: transifex pull
rkitover Dec 12, 2025
fb481e6
translations: transifex pull
rkitover Dec 12, 2025
cf4b8e4
Further improve keybinds and menu display on macOS
rkitover Dec 12, 2025
918bbfc
translations: rebuild source .pot
rkitover Dec 12, 2025
d0e9617
translations: transifex pull
rkitover Dec 12, 2025
8561e4c
Merge remote-tracking branch 'libretro/master' into libretro-merge
rkitover Dec 12, 2025
56ae12b
Fix, optimize and activate filter threads
rkitover Dec 13, 2025
f91e802
Merge remote-tracking branch 'libretro-merge'
rkitover Dec 13, 2025
20d4130
build: add Homebrew openssl to prefix path
rkitover Dec 13, 2025
d13d724
translations: transifex pull
rkitover Dec 13, 2025
bcb3883
translations: transifex pull
rkitover Dec 13, 2025
c8607e4
Fix test option-test.cpp
rkitover Dec 14, 2025
f61bf30
Update googletest submodule
rkitover Dec 14, 2025
fd82031
Fix tests for XP build
rkitover Dec 14, 2025
32d3bf0
Fix warnings in Debug XP build
rkitover Dec 14, 2025
58a4e84
ci: add workflow for XP build
rkitover Dec 14, 2025
161ef78
build: fix bundled ps12exe
rkitover Dec 14, 2025
2c89682
Define `INVALID_SOCKET` for non-WIN32
rkitover Dec 14, 2025
ddff366
Fix the XP CI job
rkitover Dec 14, 2025
e150926
build: improve finding SDL3/2
rkitover Dec 14, 2025
c9b668f
Try to set compilers for XP build
rkitover Dec 14, 2025
266a56e
ci: hopefully fix XP CI job
rkitover Dec 14, 2025
788a462
ci: hopefully fix XP job again
rkitover Dec 14, 2025
117a169
build: set drive prefix for XP toolchain
rkitover Dec 14, 2025
c4c06bd
translations: transifex pull
rkitover Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/visual-studio-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:

- name: Configure
run: >-
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=${{ matrix.cmake_vcpkg_triplet }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
cmake -B build -G ${{ matrix.cmake_generator }} -DBUILD_TESTING=OFF -DCOMPILE_ONLY=TRUE -DUPSTREAM_RELEASE=FALSE -DVCPKG_TARGET_TRIPLET=${{ matrix.cmake_vcpkg_triplet }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}

- name: Build
run: cmake --build build

# Run tests
- if: matrix.build_options == 'default' && matrix.msvc_arch != 'amd64_arm64'
name: Run tests
run: cd build && ctest -j --output-on-failure
# - if: matrix.build_options == 'default' && matrix.msvc_arch != 'amd64_arm64'
# name: Run tests
# run: cd build && ctest -j --output-on-failure
48 changes: 48 additions & 0 deletions .github/workflows/winxp-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Windows XP
on: [push, pull_request]

jobs:
build:
strategy:
matrix:
build_type: [release, debug]
build_options: [default, link_off]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
runs-on: windows-latest

steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Download and extract Windows XP toolchain
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://cachemiss.com/files/winxp-mingw32.7z" -OutFile "winxp-mingw32.7z"
ri -r -fo C:\msys64\mingw32
7z x winxp-mingw32.7z -oC:\msys64 -y

- name: Configure CMake
shell: pwsh
run: >-
cmake -B build -G Ninja
-DVCPKG_TARGET_TRIPLET=x86-mingw-static
-DBUILD_TESTING=ON
${{ matrix.cmake_build }}
${{ matrix.cmake_options }}

- name: Build
shell: pwsh
run: cmake --build build

- name: Run tests
if: matrix.build_options == 'default'
shell: pwsh
run: ctest -j --output-on-failure --test-dir build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.o
*.so
*.dll
!third_party/ps12exe/src/bin/**/*.dll
*.exe
.vscode/
.claude/
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,28 @@ if(BUILD_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)

if(NOT EXISTS third_party/googletest/CMakeLists.txt)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/third_party/googletest/CMakeLists.txt)
execute_process(
COMMAND git submodule update --init --recursive -- third_party/googletest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()

if(EXISTS third_party/googletest/CMakeLists.txt)
if(EXISTS ${CMAKE_SOURCE_DIR}/third_party/googletest/CMakeLists.txt)
add_subdirectory(./third_party/googletest)

# Make sure not use fast-math optimizations for gtest
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(gtest PRIVATE -fno-fast-math -Wno-error -w)
target_compile_options(gtest_main PRIVATE -fno-fast-math -Wno-error -w)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
target_compile_options(gtest PRIVATE -O3 -fno-fast-math -Wno-error -w -DGTEST_API_=/**/)
target_compile_options(gtest_main PRIVATE -O3 -fno-fast-math -Wno-error -w -DGTEST_API_=/**/)
target_compile_options(gmock PRIVATE -O3 -fno-fast-math -Wno-error -w -DGTEST_API_=/**/)
target_compile_options(gmock_main PRIVATE -O3 -fno-fast-math -Wno-error -w -DGTEST_API_=/**/)

add_compile_definitions(-DGTEST_API_=/**/)
endif()

include(GoogleTest)
include(GTestDiscoverTests)
else()
set(BUILD_TESTING OFF)
endif()
Expand Down
20 changes: 3 additions & 17 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ if((NOT ENABLE_SDL3) AND CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
endif()

if(ENABLE_SDL3)
if(UNIX AND NOT APPLE)
set(VBAM_SDL_LIBS "${SDL3_LIBRARIES}")
if(VBAM_STATIC)
set(VBAM_SDL_LIBS SDL3::SDL3-static ${SDL_LIBRARY_TEMP})
else()
if(VBAM_STATIC)
set(VBAM_SDL_LIBS SDL3::SDL3-static ${SDL_LIBRARY_TEMP})
else()
set(VBAM_SDL_LIBS SDL3::SDL3 ${SDL_LIBRARY_TEMP})
endif()
set(VBAM_SDL_LIBS SDL3::SDL3 ${SDL_LIBRARY_TEMP})
endif()
else()
if(VBAM_STATIC)
Expand Down Expand Up @@ -115,16 +111,6 @@ else()
add_compile_definitions(NO_LINK)
endif()

# for now, only GBALink.cpp uses gettext() directly
if(APPLE)
# use Homebrew gettext if available
if(EXISTS "/usr/local/opt/gettext")
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};/usr/local/opt/gettext/include")
set(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};/usr/local/opt/gettext/lib")
set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};/usr/local/opt/gettext/bin")
endif()
endif()

if(ENABLE_LINK OR ENABLE_WX)
find_path(LIBINTL_INC libintl.h)

Expand Down
40 changes: 40 additions & 0 deletions cmake/GTestDiscoverTests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Helper module for gtest_discover_tests that handles MinGW PATH issues.
#
# When building 32-bit MinGW from a 64-bit shell (or vice versa), the test
# executables may fail to run because they find the wrong architecture DLLs
# in PATH. This module detects the MinGW bin directory from the compiler path
# and creates a wrapper script that sets the correct PATH before running tests.

# Detect MinGW bin directory from compiler path.
if(MINGW AND CMAKE_CXX_COMPILER)
get_filename_component(MINGW_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
# Convert to native path format for Windows.
file(TO_NATIVE_PATH "${MINGW_BIN_DIR}" MINGW_BIN_DIR_NATIVE)

# Create a wrapper script that sets the PATH and runs the test executable.
# This is used as CROSSCOMPILING_EMULATOR to handle test discovery and execution.
set(MINGW_TEST_WRAPPER "${CMAKE_BINARY_DIR}/mingw-test-wrapper.cmd")
file(WRITE "${MINGW_TEST_WRAPPER}"
"@echo off
set \"PATH=${MINGW_BIN_DIR_NATIVE};%PATH%\"
%*
")
endif()

# Wrapper function for gtest_discover_tests that sets up the correct
# environment for MinGW builds.
#
# Usage:
# vbam_gtest_discover_tests(<target>)
#
function(vbam_gtest_discover_tests TARGET)
if(MINGW AND MINGW_TEST_WRAPPER)
# Use the wrapper script as CROSSCOMPILING_EMULATOR to ensure the
# correct PATH is set during both test discovery and execution.
set_target_properties(${TARGET} PROPERTIES
CROSSCOMPILING_EMULATOR "${MINGW_TEST_WRAPPER}"
)
endif()

gtest_discover_tests(${TARGET})
endfunction()
11 changes: 10 additions & 1 deletion cmake/MacPackageManagers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ elseif((NOT "$ENV{HOMEBREW_PREFIX}" STREQUAL "") OR HOMEBREW_EXECUTABLE)
include_directories(SYSTEM "${MAC_HOMEBREW_LZMA_PREFIX}/include")
endif()

set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${MAC_HOMEBREW_GETTEXT_PREFIX};${MAC_HOMEBREW_BZIP2_PREFIX};${MAC_HOMEBREW_LZMA_PREFIX}")
file(GLOB MAC_HOMEBREW_OPENSSL_DIR "${MAC_HOMEBREW_PREFIX}/Cellar/openssl@3/*")
if(MAC_HOMEBREW_OPENSSL_DIR)
list(SORT MAC_HOMEBREW_OPENSSL_DIR)
list(REVERSE MAC_HOMEBREW_OPENSSL_DIR)
list(GET MAC_HOMEBREW_OPENSSL_DIR 0 MAC_HOMEBREW_OPENSSL_PREFIX)

include_directories(SYSTEM "${MAC_HOMEBREW_OPENSSL_PREFIX}/include")
endif()

set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${MAC_HOMEBREW_GETTEXT_PREFIX};${MAC_HOMEBREW_BZIP2_PREFIX};${MAC_HOMEBREW_LZMA_PREFIX};${MAC_HOMEBREW_OPENSSL_PREFIX}")
elseif(EXISTS /opt/local/bin/port AND $ENV{PATH} MATCHES "(^|:)/opt/local/bin/?(:|$)")
message(STATUS "Configuring for MacPorts")

Expand Down
146 changes: 133 additions & 13 deletions cmake/Options.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
option(BUILD_TESTING "Build testing" ON)
option(BUILD_SHARED_LIBS "Build dynamic libraries" OFF)
option(COMPILE_ONLY "Compile source files only, skip linking executables" OFF)

# Detect CI environment or allow explicit setting
if(DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS} OR DEFINED ENV{GITLAB_CI})
Expand Down Expand Up @@ -64,21 +65,17 @@ endif()

find_package(PkgConfig)

if(UNIX AND NOT APPLE)
pkg_check_modules(SDL3 sdl3 QUIET)
else()
find_package(SDL3 QUIET)
endif()
find_package(SDL3 QUIET)

option(ENABLE_SDL3 "Use SDL3" "${SDL3_FOUND}")

if(NOT TRANSLATIONS_ONLY)
if(ENABLE_SDL3)
if(NOT UNIX)
find_package(SDL3 REQUIRED)
endif()
else()
find_package(SDL2 REQUIRED)
if(NOT ENABLE_SDL3)
find_package(SDL2 QUIET)
endif()

if(NOT SDL3_FOUND AND NOT SDL2_FOUND)
message(FATAL_ERROR "SDL2 or SDL3 is required, preferred SDL3")
endif()
endif()

Expand Down Expand Up @@ -194,7 +191,7 @@ if(WIN32)
option(ENABLE_DIRECT3D "Enable Direct3D rendering for the wxWidgets port" ON)

set(XAUDIO2_DEFAULT ON)
if ((MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang))
if ((MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
# TODO: We should update the XAudio headers to build with clang-cl. See
# https://github.com/visualboyadvance-m/visualboyadvance-m/issues/1021
set(XAUDIO2_DEFAULT OFF)
Expand All @@ -218,7 +215,130 @@ set(ENABLE_FAUDIO_DEFAULT OFF)
find_package(FAudio QUIET)

if(FAudio_FOUND)
set(ENABLE_FAUDIO_DEFAULT ON)
# Check that FAudio links to the same SDL version we're using.
# FAudio built with SDL2 won't work with SDL3 and vice versa.
set(_faudio_sdl_mismatch OFF)

# Check INTERFACE_LINK_LIBRARIES on FAudio targets for SDL version.
foreach(_faudio_target FAudio::FAudio FAudio::FAudio-shared FAudio::FAudio-static)
if(TARGET ${_faudio_target})
get_target_property(_faudio_link_libs ${_faudio_target} INTERFACE_LINK_LIBRARIES)
if(_faudio_link_libs)
if(ENABLE_SDL3)
# We're using SDL3, FAudio must link to SDL3
if(_faudio_link_libs MATCHES "SDL2")
set(_faudio_sdl_mismatch ON)
message(STATUS "FAudio was built with SDL2, but we're using SDL3 - disabling FAudio")
endif()
else()
# We're using SDL2, FAudio must link to SDL2
if(_faudio_link_libs MATCHES "SDL3")
set(_faudio_sdl_mismatch ON)
message(STATUS "FAudio was built with SDL3, but we're using SDL2 - disabling FAudio")
endif()
endif()
break()
endif()
endif()
endforeach()

# For static libraries without INTERFACE_LINK_LIBRARIES, check symbols.
if(NOT WIN32 AND NOT _faudio_sdl_mismatch AND VBAM_STATIC)
foreach(_faudio_target FAudio::FAudio-static FAudio::FAudio)
if(TARGET ${_faudio_target})
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION)
if(NOT _faudio_location)
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION_RELEASE)
endif()
if(NOT _faudio_location)
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION_RELWITHDEBINFO)
endif()
if(_faudio_location AND EXISTS "${_faudio_location}")
# SDL_GetNumAudioDevices exists in SDL2 but not SDL3
# SDL_GetAudioPlaybackDevices exists in SDL3 but not SDL2
execute_process(
COMMAND nm -g "${_faudio_location}"
OUTPUT_VARIABLE _faudio_symbols
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(_faudio_symbols)
string(FIND "${_faudio_symbols}" "SDL_GetNumAudioDevices" _has_sdl2_symbol)
string(FIND "${_faudio_symbols}" "SDL_GetAudioPlaybackDevices" _has_sdl3_symbol)

if(ENABLE_SDL3 AND _has_sdl2_symbol GREATER -1 AND _has_sdl3_symbol EQUAL -1)
set(_faudio_sdl_mismatch ON)
message(STATUS "Static FAudio uses SDL2 symbols, but we're using SDL3 - disabling FAudio")
elseif(NOT ENABLE_SDL3 AND _has_sdl3_symbol GREATER -1 AND _has_sdl2_symbol EQUAL -1)
set(_faudio_sdl_mismatch ON)
message(STATUS "Static FAudio uses SDL3 symbols, but we're using SDL2 - disabling FAudio")
endif()
endif()
break()
endif()
endif()
endforeach()
endif()

# For dynamic libraries, also check with ldd/otool if target properties didn't help.
if(NOT WIN32 AND NOT _faudio_sdl_mismatch AND NOT VBAM_STATIC)
foreach(_faudio_target FAudio::FAudio-shared FAudio::FAudio)
if(TARGET ${_faudio_target})
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION)
if(NOT _faudio_location)
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION_RELEASE)
endif()
if(NOT _faudio_location)
get_target_property(_faudio_location ${_faudio_target} IMPORTED_LOCATION_RELWITHDEBINFO)
endif()
if(_faudio_location AND EXISTS "${_faudio_location}")
if(APPLE)
execute_process(
COMMAND otool -L "${_faudio_location}"
OUTPUT_VARIABLE _faudio_deps
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
elseif(UNIX)
execute_process(
COMMAND ldd "${_faudio_location}"
OUTPUT_VARIABLE _faudio_deps
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(_faudio_deps)
string(FIND "${_faudio_deps}" "libSDL2" _links_sdl2)
string(FIND "${_faudio_deps}" "libSDL3" _links_sdl3)

if(ENABLE_SDL3 AND _links_sdl2 GREATER -1)
set(_faudio_sdl_mismatch ON)
message(STATUS "FAudio links to libSDL2, but we're using SDL3 - disabling FAudio")
elseif(NOT ENABLE_SDL3 AND _links_sdl3 GREATER -1)
set(_faudio_sdl_mismatch ON)
message(STATUS "FAudio links to libSDL3, but we're using SDL2 - disabling FAudio")
endif()
endif()
break()
endif()
endif()
endforeach()
endif()

if(NOT _faudio_sdl_mismatch)
set(ENABLE_FAUDIO_DEFAULT ON)
endif()

unset(_faudio_sdl_mismatch)
unset(_faudio_link_libs)
unset(_faudio_target)
unset(_faudio_location)
unset(_faudio_symbols)
unset(_faudio_deps)
unset(_has_sdl2_symbol)
unset(_has_sdl3_symbol)
unset(_links_sdl2)
unset(_links_sdl3)
endif()

option(ENABLE_FAUDIO "Enable FAudio sound output for the wxWidgets port" ${ENABLE_FAUDIO_DEFAULT})
Expand Down
2 changes: 1 addition & 1 deletion cmake/Set-Toolchain-vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(WIN32 AND VCPKG_TARGET_TRIPLET MATCHES "^x86-mingw")

if(NOT make_path)
# Assume MSYS2 MinGW32 toolchain.
set(ENV{PATH} "/msys64/mingw32/bin;$ENV{PATH}")
set(ENV{PATH} "C:/msys64/mingw32/bin;$ENV{PATH}")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/Toolchain-gcc-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else()
endif()
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(-Wno-unused-command-line-argument -Wno-unknown-pragmas)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-feliminate-unused-debug-types)
Expand Down
Loading
Loading