Skip to content

Commit e954eb5

Browse files
committed
Merge branch 'main' of https://github.com/libsdl-org/SDL
2 parents 4d331f4 + 23e08f7 commit e954eb5

File tree

98 files changed

+1750
-650
lines changed

Some content is hidden

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

98 files changed

+1750
-650
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
658658
job.cmake_arguments.extend((
659659
f"-DCMAKE_C_COMPILER={job.cc}",
660660
f"-DCMAKE_CXX_COMPILER={job.cxx}",
661-
"-DSDL_UNIX_CONSOLE_BUILD=ON",
661+
"-DCMAKE_SYSTEM_NAME=Haiku",
662662
))
663663
job.shared_lib = SharedLibType.SO_0
664664
job.static_lib = StaticLibType.A

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ jobs:
562562
run: |
563563
python build-scripts/build-release.py \
564564
--actions android \
565-
--android-api 23 \
565+
--android-api 21 \
566566
--android-ndk-home "${{ steps.setup-ndk.outputs.ndk-path }}" \
567567
--commit ${{ inputs.commit }} \
568568
--root "${{ steps.tar.outputs.path }}" \

Android.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
108108

109109
LOCAL_LDFLAGS := -Wl,--no-undefined -Wl,--no-undefined-version -Wl,--version-script=$(LOCAL_PATH)/src/dynapi/SDL_dynapi.sym
110110

111+
# https://developer.android.com/guide/practices/page-sizes
112+
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
113+
LOCAL_LDFLAGS += "-Wl,-z,common-page-size=16384"
114+
111115
ifeq ($(NDK_DEBUG),1)
112116
cmd-strip :=
113117
endif

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ if(SDL_SHARED)
448448
add_library(SDL3-shared SHARED)
449449
add_library(SDL3::SDL3-shared ALIAS SDL3-shared)
450450
SDL_AddCommonCompilerFlags(SDL3-shared)
451+
set_property(TARGET SDL3-shared PROPERTY UNITY_BUILD OFF)
451452
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
452453
target_compile_features(SDL3-shared PRIVATE c_std_99)
453454
else()
@@ -459,6 +460,7 @@ if(SDL_STATIC)
459460
add_library(SDL3-static STATIC)
460461
add_library(SDL3::SDL3-static ALIAS SDL3-static)
461462
SDL_AddCommonCompilerFlags(SDL3-static)
463+
set_property(TARGET SDL3-static PROPERTY UNITY_BUILD OFF)
462464
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
463465
target_compile_features(SDL3-static PRIVATE c_std_99)
464466
else()
@@ -1228,6 +1230,7 @@ target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/src")
12281230
target_include_directories(SDL_uclibc PRIVATE "${SDL3_SOURCE_DIR}/include")
12291231
SDL_AddCommonCompilerFlags(SDL_uclibc)
12301232
sdl_sources(STATIC "$<TARGET_OBJECTS:SDL_uclibc>")
1233+
set_property(TARGET SDL_uclibc PROPERTY UNITY_BUILD OFF)
12311234
if(TARGET SDL3-shared)
12321235
target_link_libraries(SDL3-shared PRIVATE SDL_uclibc)
12331236
endif()
@@ -1508,6 +1511,12 @@ if(ANDROID)
15081511
endif()
15091512
endif()
15101513
endif()
1514+
1515+
if(TARGET SDL3-shared)
1516+
target_link_options(SDL3-shared PRIVATE "-Wl,-z,max-page-size=16384")
1517+
target_link_options(SDL3-shared PRIVATE "-Wl,-z,common-page-size=16384")
1518+
endif()
1519+
15111520
elseif(OHOS)
15121521
# disable warnings from the toolchain
15131522
sdl_compile_options(PRIVATE "-Wno-unused-command-line-argument")
@@ -2051,7 +2060,6 @@ elseif(WINDOWS)
20512060
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
20522061
check_include_file(sensorsapi.h HAVE_SENSORSAPI_H)
20532062
check_include_file(shellscalingapi.h HAVE_SHELLSCALINGAPI_H)
2054-
check_include_file(shobjidl_core.h HAVE_SHOBJIDL_CORE_H)
20552063
check_c_source_compiles("
20562064
#include <windows.h>
20572065
#include <mfapi.h>

android-project/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ android {
1919
abiFilters 'arm64-v8a'
2020
}
2121
cmake {
22-
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_static"
22+
arguments "-DANDROID_PLATFORM=android-21", "-DANDROID_STL=c++_static", "-DAPP_SUPPORT_FLEXIBLE_PAGE_SIZES=true"
2323
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
2424
abiFilters 'arm64-v8a'
2525
}

android-project/app/jni/Application.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
88

99
# Min runtime API level
10-
APP_PLATFORM=android-16
10+
APP_PLATFORM=android-21
11+
12+
# https://developer.android.com/guide/practices/page-sizes#update-packaging
13+
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true

android-project/app/jni/src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ endif()
2626
add_library(main SHARED
2727
YourSourceHere.c
2828
)
29+
30+
#https://developer.android.com/guide/practices/page-sizes#update-packaging
31+
target_link_options(main PRIVATE "-Wl,-z,max-page-size=16384")
32+
target_link_options(main PRIVATE "-Wl,-z,common-page-size=16384")
33+
2934
target_link_libraries(main PRIVATE SDL3::SDL3)

build-scripts/SDL_migration.cocci

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ expression e;
116116
@@
117117
- SDL_JoystickGetDevicePlayerIndex(e)
118118
+ /* FIXME MIGRATION: check for valid instance */
119-
+ SDL_GetJoystickInstancePlayerIndex(GetJoystickInstanceFromIndex(e))
119+
+ SDL_GetJoystickPlayerIndexForID(GetJoystickInstanceFromIndex(e))
120120

121121
@@
122122
expression e;
@@ -130,7 +130,7 @@ expression e;
130130
@@
131131
- SDL_JoystickPathForIndex(e)
132132
+ /* FIXME MIGRATION: check for valid instance */
133-
+ SDL_GetJoystickInstancePath(GetJoystickInstanceFromIndex(e))
133+
+ SDL_GetJoystickPathForID(GetJoystickInstanceFromIndex(e))
134134

135135
@@
136136
expression e;
@@ -144,28 +144,28 @@ expression e;
144144
@@
145145
- SDL_GameControllerMappingForDeviceIndex(e)
146146
+ /* FIXME MIGRATION: check for valid instance */
147-
+ SDL_GetGamepadInstanceMapping(GetJoystickInstanceFromIndex(e))
147+
+ SDL_GetGamepadMappingForID(GetJoystickInstanceFromIndex(e))
148148

149149
@@
150150
expression e;
151151
@@
152152
- SDL_GameControllerNameForIndex(e)
153153
+ /* FIXME MIGRATION: check for valid instance */
154-
+ SDL_GetGamepadInstanceName(GetJoystickInstanceFromIndex(e))
154+
+ SDL_GetGamepadNameForID(GetJoystickInstanceFromIndex(e))
155155

156156
@@
157157
expression e;
158158
@@
159159
- SDL_GameControllerPathForIndex(e)
160160
+ /* FIXME MIGRATION: check for valid instance */
161-
+ SDL_GetGamepadInstancePath(GetJoystickInstanceFromIndex(e))
161+
+ SDL_GetGamepadPathForID(GetJoystickInstanceFromIndex(e))
162162

163163
@@
164164
expression e;
165165
@@
166166
- SDL_GameControllerTypeForIndex(e)
167167
+ /* FIXME MIGRATION: check for valid instance */
168-
+ SDL_GetGamepadInstanceType(GetJoystickInstanceFromIndex(e))
168+
+ SDL_GetGamepadTypeForID(GetJoystickInstanceFromIndex(e))
169169

170170

171171
// SDL_Has3DNow() has been removed; there is no replacement.

build-scripts/androidbuildlibs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64"
3030
obj=
3131
lib=
3232
ndk_args=
33+
flexpage=true
3334

3435
# Allow an external caller to specify locations and platform.
3536
while [ $# -gt 0 ]; do
@@ -42,6 +43,8 @@ while [ $# -gt 0 ]; do
4243
platform=${arg#APP_PLATFORM=}
4344
elif [ "${arg:0:8}" == "APP_ABI=" ]; then
4445
abi=${arg#APP_ABI=}
46+
elif [ "${arg:0:32}" == "APP_SUPPORT_FLEXIBLE_PAGE_SIZES=" ]; then
47+
flexpage=${arg#APP_SUPPORT_FLEXIBLE_PAGE_SIZES=}
4548
else
4649
ndk_args="$ndk_args $arg"
4750
fi
@@ -67,6 +70,9 @@ done
6770
# APP_* variables set in the environment here will not be seen by the
6871
# ndk-build makefile segments that use them, e.g., default-application.mk.
6972
# For consistency, pass all values on the command line.
73+
#
74+
# Add support for Google Play 16 KB Page size requirement:
75+
# https://developer.android.com/guide/practices/page-sizes#ndk-build
7076
ndk-build \
7177
NDK_PROJECT_PATH=null \
7278
NDK_OUT=$obj \
@@ -75,4 +81,5 @@ ndk-build \
7581
APP_ABI="$abi" \
7682
APP_PLATFORM="$platform" \
7783
APP_MODULES="SDL3" \
84+
APP_SUPPORT_FLEXIBLE_PAGE_SIZES="$flexpage" \
7885
$ndk_args

cmake/PreseedMSVCCache.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ if(MSVC)
1515
set(HAVE_MMDEVICEAPI_H "1" CACHE INTERNAL "Have include mmdeviceapi.h")
1616
set(HAVE_SENSORSAPI_H "1" CACHE INTERNAL "Have include sensorsapi.h")
1717
set(HAVE_SHELLSCALINGAPI_H "1" CACHE INTERNAL "Have include shellscalingapi.h")
18-
set(HAVE_SHOBJIDL_CORE_H "1" CACHE INTERNAL "Have include shobjidl_core.h")
1918
set(HAVE_TPCSHRD_H "1" CACHE INTERNAL "Have include tpcshrd.h")
2019
set(HAVE_WIN32_CC "1" CACHE INTERNAL "Test HAVE_WIN32_CC")
2120
set(HAVE_XINPUT_H "1" CACHE INTERNAL "Test HAVE_XINPUT_H")

0 commit comments

Comments
 (0)