Skip to content

Commit eac69a2

Browse files
authored
Merge branch 'libsdl-org:main' into main
2 parents 768c89c + 2ed1c35 commit eac69a2

File tree

130 files changed

+3639
-1322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3639
-1322
lines changed

.github/workflows/create-test-plan.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class JobDetails:
182182
brew_packages: list[str] = dataclasses.field(default_factory=list)
183183
cmake_toolchain_file: str = ""
184184
cmake_arguments: list[str] = dataclasses.field(default_factory=list)
185+
cmake_generator: str = "Ninja"
185186
cmake_build_arguments: list[str] = dataclasses.field(default_factory=list)
186187
clang_tidy: bool = True
187188
cppflags: list[str] = dataclasses.field(default_factory=list)
@@ -231,6 +232,7 @@ class JobDetails:
231232
setup_python: bool = False
232233
pypi_packages: list[str] = dataclasses.field(default_factory=list)
233234
setup_gage_sdk_path: str = ""
235+
binutils_strings: str = "strings"
234236

235237
def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
236238
data = {
@@ -264,6 +266,7 @@ def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
264266
"cflags": my_shlex_join(self.cppflags + self.cflags),
265267
"cxxflags": my_shlex_join(self.cppflags + self.cxxflags),
266268
"ldflags": my_shlex_join(self.ldflags),
269+
"cmake-generator": self.cmake_generator,
267270
"cmake-toolchain-file": self.cmake_toolchain_file,
268271
"clang-tidy": self.clang_tidy,
269272
"cmake-arguments": my_shlex_join(self.cmake_arguments),
@@ -299,6 +302,7 @@ def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
299302
"setup-python": self.setup_python,
300303
"pypi-packages": my_shlex_join(self.pypi_packages),
301304
"setup-ngage-sdk-path": self.setup_gage_sdk_path,
305+
"binutils-strings": self.binutils_strings,
302306
}
303307
return {k: v for k, v in data.items() if v != ""}
304308

@@ -687,13 +691,16 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
687691
job.shared_lib = SharedLibType.SO_0
688692
job.static_lib = StaticLibType.A
689693
case SdlPlatform.N3ds:
690-
job.ccache = True
694+
job.cmake_generator = "Unix Makefiles"
695+
job.cmake_build_arguments.append("-j$(nproc)")
696+
job.ccache = False
691697
job.shared = False
692-
job.apt_packages = ["ccache", "ninja-build", "binutils"]
698+
job.apt_packages = []
693699
job.clang_tidy = False
694700
job.run_tests = False
695701
job.cc_from_cmake = True
696702
job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake"
703+
job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings"
697704
job.static_lib = StaticLibType.A
698705
case SdlPlatform.Msys2:
699706
job.ccache = True

.github/workflows/generic.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
#shell: ${{ matrix.platform.shell }}
210210
run: |
211211
${{ matrix.platform.source-cmd }}
212-
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -GNinja \
212+
${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \
213213
-Wdeprecated -Wdev -Werror \
214214
${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \
215215
-DSDL_WERROR=${{ matrix.platform.werror }} \
@@ -240,9 +240,9 @@ jobs:
240240
run: |
241241
echo "This should show us the SDL_REVISION"
242242
echo "Shared library:"
243-
${{ (matrix.platform.shared-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
243+
${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo "<Shared library not supported by platform>"' }}
244244
echo "Static library:"
245-
${{ (matrix.platform.static-lib && format('strings build/{0} | grep "Github Workflow"', matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
245+
${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo "<Static library not supported by platform>"' }}
246246
- name: 'Run build-time tests (CMake)'
247247
id: tests
248248
if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ jobs:
256256
257257
msvc:
258258
needs: [src]
259-
runs-on: windows-2019
259+
runs-on: windows-2025
260260
outputs:
261261
VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
262262
VC-x64: ${{ steps.releaser.outputs.VC-x64 }}

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,12 @@ if(MSVC)
189189
# Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
190190
foreach(flag_var
191191
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
192-
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
192+
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
193+
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
194+
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
193195
string(REGEX REPLACE "/RTC(su|[1su])" "" ${flag_var} "${${flag_var}}")
194196
endforeach(flag_var)
197+
set(CMAKE_MSVC_RUNTIME_CHECKS "")
195198
endif()
196199

197200
if(MSVC_CLANG)
@@ -654,6 +657,11 @@ if(MSVC)
654657
# Mark SDL3.dll as compatible with Control-flow Enforcement Technology (CET)
655658
sdl_shared_link_options("-CETCOMPAT")
656659
endif()
660+
661+
# for VS >= 17.14 targeting ARM64: inline the Interlocked funcs
662+
if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC)
663+
sdl_compile_options(PRIVATE "/forceInterlockedFunctions-")
664+
endif()
657665
endif()
658666

659667
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")

VisualC-GDK/SDL/SDL.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@
723723
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
724724
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
725725
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
726+
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
726727
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
727728
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
728729
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />

VisualC-GDK/SDL/SDL.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
7575
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
7676
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
77+
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
7778
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
7879
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
7980
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />

VisualC/SDL/SDL.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@
613613
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
614614
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
615615
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
616+
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c" />
616617
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
617618
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
618619
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
@@ -774,4 +775,4 @@
774775
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
775776
<ImportGroup Label="ExtensionTargets">
776777
</ImportGroup>
777-
</Project>
778+
</Project>

VisualC/SDL/SDL.vcxproj.filters

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,9 @@
12151215
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c">
12161216
<Filter>joystick\hidapi</Filter>
12171217
</ClCompile>
1218+
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_sinput.c">
1219+
<Filter>joystick\hidapi</Filter>
1220+
</ClCompile>
12181221
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c">
12191222
<Filter>joystick\hidapi</Filter>
12201223
</ClCompile>
@@ -1615,4 +1618,4 @@
16151618
<ItemGroup>
16161619
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
16171620
</ItemGroup>
1618-
</Project>
1621+
</Project>

Xcode/SDL/SDL.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
89E580242D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c in Sources */ = {isa = PBXBuildFile; fileRef = 89E580212D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c */; };
7777
89E580252D03606400DAF6D3 /* SDL_hidapihaptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 89E580202D03606400DAF6D3 /* SDL_hidapihaptic_c.h */; };
7878
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */ = {isa = PBXBuildFile; fileRef = 9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */; };
79+
02D6A1C228A84B8F00A7F002 /* SDL_hidapi_sinput.c in Sources */ = {isa = PBXBuildFile; fileRef = 02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */; };
7980
A1626A3E2617006A003F1973 /* SDL_triangle.c in Sources */ = {isa = PBXBuildFile; fileRef = A1626A3D2617006A003F1973 /* SDL_triangle.c */; };
8081
A1626A522617008D003F1973 /* SDL_triangle.h in Headers */ = {isa = PBXBuildFile; fileRef = A1626A512617008C003F1973 /* SDL_triangle.h */; };
8182
A1BB8B6327F6CF330057CFA8 /* SDL_list.c in Sources */ = {isa = PBXBuildFile; fileRef = A1BB8B6127F6CF320057CFA8 /* SDL_list.c */; };
@@ -620,6 +621,7 @@
620621
89E580202D03606400DAF6D3 /* SDL_hidapihaptic_c.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapihaptic_c.h; sourceTree = "<group>"; };
621622
89E580212D03606400DAF6D3 /* SDL_hidapihaptic_lg4ff.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapihaptic_lg4ff.c; sourceTree = "<group>"; };
622623
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_shield.c; sourceTree = "<group>"; };
624+
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_sinput.c; sourceTree = "<group>"; };
623625
A1626A3D2617006A003F1973 /* SDL_triangle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_triangle.c; sourceTree = "<group>"; };
624626
A1626A512617008C003F1973 /* SDL_triangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_triangle.h; sourceTree = "<group>"; };
625627
A1BB8B6127F6CF320057CFA8 /* SDL_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_list.c; sourceTree = "<group>"; };
@@ -1943,6 +1945,7 @@
19431945
A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */,
19441946
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */,
19451947
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */,
1948+
02D6A1C128A84B8F00A7F001 /* SDL_hidapi_sinput.c */,
19461949
F3984CCF25BCC92800374F43 /* SDL_hidapi_stadia.c */,
19471950
A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */,
19481951
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */,
@@ -2877,6 +2880,7 @@
28772880
A7D8B62F23E2514300DCD162 /* SDL_sysfilesystem.m in Sources */,
28782881
A7D8B41C23E2514300DCD162 /* SDL_systls.c in Sources */,
28792882
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */,
2883+
02D6A1C228A84B8F00A7F002 /* SDL_hidapi_sinput.c in Sources */,
28802884
F31013C72C24E98200FBE946 /* SDL_keymap.c in Sources */,
28812885
F3A9AE992C8A13C100AAC390 /* SDL_render_gpu.c in Sources */,
28822886
A7D8BBD923E2574800DCD162 /* SDL_uikitmessagebox.m in Sources */,

docs/README-macos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ NSApplicationDelegate implementation:
4949
```objc
5050
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
5151
{
52-
if (SDL_GetEventState(SDL_EVENT_QUIT) == SDL_ENABLE) {
52+
if (SDL_EventEnabled(SDL_EVENT_QUIT)) {
5353
SDL_Event event;
5454
SDL_zero(event);
5555
event.type = SDL_EVENT_QUIT;
@@ -61,7 +61,7 @@ NSApplicationDelegate implementation:
6161

6262
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
6363
{
64-
if (SDL_GetEventState(SDL_EVENT_DROP_FILE) == SDL_ENABLE) {
64+
if (SDL_EventEnabled(SDL_EVENT_DROP_FILE)) {
6565
SDL_Event event;
6666
SDL_zero(event);
6767
event.type = SDL_EVENT_DROP_FILE;

0 commit comments

Comments
 (0)