Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
flyinghead committed Jul 11, 2024
2 parents b9cbf3e + 2a4356e commit 39e04b0
Show file tree
Hide file tree
Showing 125 changed files with 2,521 additions and 24,954 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@
[submodule "core/deps/rcheevos"]
path = core/deps/rcheevos
url = https://github.com/RetroAchievements/rcheevos.git
[submodule "core/deps/googletest"]
path = core/deps/googletest
url = https://github.com/google/googletest.git
50 changes: 32 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,21 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(WINDOWS_STORE)
string(REGEX REPLACE "[Vv]" "" MS_VERSION ${GIT_VERSION})
string(REPLACE "-" "." MS_VERSION ${MS_VERSION})
string(REGEX REPLACE "\.g[0-9a-f]+" "" MS_VERSION ${MS_VERSION})
string(REGEX MATCHALL "[0-9]+" VERSION_PARTS ${MS_VERSION})
list(LENGTH VERSION_PARTS VERSION_PARTS_LENGTH)
if(VERSION_PARTS_LENGTH EQUAL 2)
string(APPEND MS_VERSION ".0.0")
elseif(VERSION_PARTS_LENGTH EQUAL 3)
string(APPEND MS_VERSION ".0")
endif()
else()
set(GIT_VERSION "v0.0.0-0-g000000000")
set(GIT_HASH "000000000")
endif()

if(WINDOWS_STORE)
string(REGEX REPLACE "[Vv]" "" MS_VERSION ${GIT_VERSION})
string(REPLACE "-" "." MS_VERSION ${MS_VERSION})
string(REGEX REPLACE "\.g[0-9a-f]+" "" MS_VERSION ${MS_VERSION})
string(REGEX MATCHALL "[0-9]+" VERSION_PARTS ${MS_VERSION})
list(LENGTH VERSION_PARTS VERSION_PARTS_LENGTH)
if(VERSION_PARTS_LENGTH EQUAL 2)
string(APPEND MS_VERSION ".0.0")
elseif(VERSION_PARTS_LENGTH EQUAL 3)
string(APPEND MS_VERSION ".0")
endif()
endif()

Expand Down Expand Up @@ -188,7 +192,11 @@ elseif(ANDROID)
target_compile_options(${PROJECT_NAME} PRIVATE -fno-stack-protector)
set(CMAKE_ANDROID_STL_TYPE "c++_static")
elseif(WIN32)
add_executable(${PROJECT_NAME} WIN32 core/emulator.cpp)
if(BUILD_TESTING)
add_executable(${PROJECT_NAME} core/emulator.cpp)
else()
add_executable(${PROJECT_NAME} WIN32 core/emulator.cpp)
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio")
if(NOT CMAKE_VS_GLOBALS MATCHES "(^|;)UseMultiToolTask=")
list(APPEND CMAKE_VS_GLOBALS UseMultiToolTask=true)
Expand Down Expand Up @@ -425,7 +433,7 @@ if(NOT LIBRETRO)
endif()

# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
if(TARGET SDL2::SDL2main)
if(TARGET SDL2::SDL2main AND NOT BUILD_TESTING)
# It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2main)
endif()
Expand Down Expand Up @@ -1804,11 +1812,13 @@ if(NOT LIBRETRO)
core/deps/SDL/src/main/winrt/SDL2-WinRTResources.rc)
target_sources(${PROJECT_NAME} PRIVATE
${ResourceFiles}
core/deps/SDL/src/main/winrt/SDL_winrt_main_NonXAML.cpp
shell/uwp/http_client.cpp)
if(NOT BUILD_TESTING)
target_sources(${PROJECT_NAME} PRIVATE core/deps/SDL/src/main/winrt/SDL_winrt_main_NonXAML.cpp)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES RESOURCE "${ResourceFiles}")
else()
if("x86" IN_LIST ARCHITECTURE OR "x86_64" IN_LIST ARCHITECTURE)
if(NOT BUILD_TESTING AND ("x86" IN_LIST ARCHITECTURE OR "x86_64" IN_LIST ARCHITECTURE))
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/Spout/SPOUTSDK/SpoutGL)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/Spout/SPOUTSDK/SpoutDirectX/SpoutDX)
SET(SPOUT_BUILD_CMT OFF CACHE BOOL "For Visual Studio - build /MT to link runtime libraries" FORCE)
Expand All @@ -1827,9 +1837,13 @@ if(NOT LIBRETRO)
endif()

if(BUILD_TESTING)
target_sources(${PROJECT_NAME} PRIVATE
core/deps/gtest/src/gtest-all.cc
core/deps/gtest/src/gtest_main.cc)
option(BUILD_GMOCK "Builds the googlemock subproject" OFF)
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" OFF)
if(WIN32)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()
add_subdirectory(core/deps/googletest EXCLUDE_FROM_ALL)
target_link_libraries(${PROJECT_NAME} PRIVATE gtest_main)

target_sources(${PROJECT_NAME} PRIVATE
tests/src/CheatManagerTest.cpp
Expand Down
1 change: 1 addition & 0 deletions core/audio/audiobackend_oboe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class OboeBackend : AudioBackend
->setFormat(oboe::AudioFormat::I16)
->setChannelCount(oboe::ChannelCount::Stereo)
->setSampleRate(44100)
->setSampleRateConversionQuality(oboe::SampleRateConversionQuality::High)
->setFramesPerCallback(SAMPLE_COUNT)
->setDataCallback(&audioCallback)
->setErrorCallback(&errorCallback)
Expand Down
2 changes: 1 addition & 1 deletion core/deps/SDL
Submodule SDL updated 53 files
+6 −8 CMakeLists.txt
+1 −1 Makefile.in
+1 −1 Makefile.os2
+1 −1 Makefile.w32
+2 −2 Xcode/SDL/Info-Framework.plist
+6 −6 Xcode/SDL/SDL.xcodeproj/project.pbxproj
+1 −1 Xcode/SDL/pkg-support/SDL.info
+1 −1 android-project/app/src/main/AndroidManifest.xml
+8 −1 android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java
+9 −5 android-project/app/src/main/java/org/libsdl/app/SDL.java
+6 −6 android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+2 −3 android-project/app/src/main/res/values/styles.xml
+6 −9 configure
+5 −8 configure.ac
+0 −3 include/SDL_config_os2.h
+3 −1 include/SDL_config_windows.h
+13 −1 include/SDL_hints.h
+10 −5 include/SDL_joystick.h
+6 −0 include/SDL_platform.h
+12 −12 include/SDL_stdinc.h
+1 −1 include/SDL_version.h
+4 −0 src/SDL_hints.c
+0 −1 src/core/linux/SDL_fcitx.c
+5 −12 src/events/SDL_events.c
+14 −1 src/events/SDL_mouse.c
+1 −0 src/events/SDL_mouse_c.h
+47 −0 src/hidapi/SDL_hidapi.c
+1 −0 src/hidapi/libusb/hid.c
+23 −37 src/joystick/SDL_gamecontroller.c
+3 −0 src/joystick/SDL_gamecontrollerdb.h
+17 −1 src/joystick/SDL_joystick.c
+3 −1 src/joystick/controller_list.h
+57 −43 src/joystick/hidapi/SDL_hidapi_ps3.c
+6 −0 src/joystick/hidapi/SDL_hidapi_ps5.c
+36 −0 src/joystick/hidapi/SDL_hidapi_switch.c
+11 −14 src/joystick/hidapi/SDL_hidapijoystick.c
+7 −0 src/joystick/hidapi/SDL_hidapijoystick_c.h
+3 −0 src/joystick/psp/SDL_sysjoystick.c
+5 −0 src/joystick/usb_ids.h
+1 −0 src/joystick/windows/SDL_xinputjoystick.c
+4 −4 src/main/windows/version.rc
+68 −14 src/render/direct3d12/SDL_render_d3d12.c
+3 −2 src/stdlib/SDL_iconv.c
+27 −20 src/stdlib/SDL_qsort.c
+12 −4 src/thread/stdcpp/SDL_systhread.cpp
+101 −72 src/video/SDL_video.c
+9 −0 src/video/kmsdrm/SDL_kmsdrmsym.h
+23 −9 src/video/kmsdrm/SDL_kmsdrmvideo.c
+35 −0 src/video/kmsdrm/SDL_kmsdrmvideo.h
+1 −5 src/video/wayland/SDL_waylandvideo.c
+2 −0 src/video/wayland/SDL_waylandwindow.c
+47 −0 src/video/windows/SDL_windowsevents.c
+75 −1 test/testautomation_video.c
1 change: 1 addition & 0 deletions core/deps/googletest
Submodule googletest added at f8d7d7
Loading

0 comments on commit 39e04b0

Please sign in to comment.