Skip to content

Commit cdde6dd

Browse files
committed
Bumped deployment requirements for Apple platforms
We require at least Xcode 12.2 and macOS SDK 11 to build. We support deploying to macOS 10.13, iOS 11.0, and tvOS 11.0. This cleans up the code significantly
1 parent 8f8af91 commit cdde6dd

29 files changed

+266
-741
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
469469
job.cmake_arguments.extend([
470470
"-DCMAKE_SYSTEM_NAME=iOS",
471471
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
472-
"-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0",
472+
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0",
473473
])
474474
case SdlPlatform.Tvos:
475475
if spec.xcode:
476476
job.xcode_sdk = 'appletvos'
477477
job.cmake_arguments.extend([
478478
"-DCMAKE_SYSTEM_NAME=tvOS",
479479
"-DCMAKE_OSX_ARCHITECTURES=\"arm64\"",
480-
"-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0",
480+
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0",
481481
])
482482
case SdlPlatform.MacOS:
483483
if spec.apple_framework:
@@ -486,15 +486,15 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
486486
job.test_pkg_config = False
487487
job.cmake_arguments.extend((
488488
"'-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64'",
489-
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11",
489+
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13",
490490
"-DSDL_FRAMEWORK=ON",
491491
))
492492
job.shared_lib = SharedLibType.FRAMEWORK
493493
else:
494494
job.clang_tidy = True
495495
job.cmake_arguments.extend((
496496
"-DCMAKE_OSX_ARCHITECTURES=arm64",
497-
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11",
497+
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13",
498498
"-DCLANG_TIDY_BINARY=$(brew --prefix llvm)/bin/clang-tidy",
499499
))
500500
job.shared_lib = SharedLibType.DYLIB

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
164164
-DCMAKE_SYSTEM_NAME=Darwin \
165165
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
166-
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
166+
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
167167
-Werror=dev \
168168
-B build_darwin
169169
cmake --build build_darwin --config Release --verbose
@@ -175,7 +175,7 @@ jobs:
175175
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/macos-arm64_x86_64" \
176176
-DCMAKE_SYSTEM_NAME=Darwin \
177177
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
178-
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
178+
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
179179
-Werror=dev \
180180
-B build_darwin_2
181181
cmake --build build_darwin --config Release --verbose
@@ -188,7 +188,7 @@ jobs:
188188
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
189189
-DCMAKE_SYSTEM_NAME=iOS \
190190
-DCMAKE_OSX_ARCHITECTURES="arm64" \
191-
-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0 \
191+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
192192
-Werror=dev \
193193
-B build_ios
194194
cmake --build build_ios --config Release --verbose
@@ -201,7 +201,7 @@ jobs:
201201
-DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
202202
-DCMAKE_SYSTEM_NAME=tvOS \
203203
-DCMAKE_OSX_ARCHITECTURES="arm64" \
204-
-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0 \
204+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
205205
-Werror=dev \
206206
-B build_tvos
207207
cmake --build build_tvos --config Release --verbose
@@ -217,7 +217,7 @@ jobs:
217217
-DCMAKE_SYSTEM_NAME=iOS \
218218
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
219219
-DCMAKE_OSX_SYSROOT="${sysroot}" \
220-
-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0 \
220+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
221221
-Werror=dev \
222222
-B build_ios_simulator
223223
cmake --build build_ios_simulator --config Release --verbose
@@ -233,7 +233,7 @@ jobs:
233233
-DCMAKE_SYSTEM_NAME=tvOS \
234234
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
235235
-DCMAKE_OSX_SYSROOT="${sysroot}" \
236-
-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0 \
236+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
237237
-Werror=dev \
238238
-B build_tvos_simulator
239239
cmake --build build_tvos_simulator --config Release --verbose

Xcode/SDL/SDL.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,7 +3073,7 @@
30733073
/usr/X11R6/include,
30743074
);
30753075
INFOPLIST_FILE = "Info-Framework.plist";
3076-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
3076+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
30773077
LD_RUNPATH_SEARCH_PATHS = (
30783078
"$(inherited)",
30793079
"@executable_path/Frameworks",
@@ -3083,15 +3083,15 @@
30833083
"@executable_path/../Frameworks",
30843084
"@loader_path/Frameworks",
30853085
);
3086-
MACOSX_DEPLOYMENT_TARGET = 10.11;
3086+
MACOSX_DEPLOYMENT_TARGET = 10.13;
30873087
MARKETING_VERSION = 3.1.9;
30883088
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
30893089
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
30903090
PRODUCT_NAME = SDL3;
30913091
STRIP_STYLE = "non-global";
30923092
SUPPORTED_PLATFORMS = "xrsimulator xros macosx iphonesimulator iphoneos appletvsimulator appletvos";
30933093
SUPPORTS_MACCATALYST = YES;
3094-
TVOS_DEPLOYMENT_TARGET = 9.0;
3094+
TVOS_DEPLOYMENT_TARGET = 11.0;
30953095
XROS_DEPLOYMENT_TARGET = 1.0;
30963096
};
30973097
name = Release;
@@ -3134,7 +3134,7 @@
31343134
/usr/X11R6/include,
31353135
);
31363136
INFOPLIST_FILE = "Info-Framework.plist";
3137-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
3137+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
31383138
LD_RUNPATH_SEARCH_PATHS = (
31393139
"$(inherited)",
31403140
"@executable_path/Frameworks",
@@ -3144,7 +3144,7 @@
31443144
"@executable_path/../Frameworks",
31453145
"@loader_path/Frameworks",
31463146
);
3147-
MACOSX_DEPLOYMENT_TARGET = 10.11;
3147+
MACOSX_DEPLOYMENT_TARGET = 10.13;
31483148
MARKETING_VERSION = 3.1.9;
31493149
ONLY_ACTIVE_ARCH = YES;
31503150
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
@@ -3153,7 +3153,7 @@
31533153
STRIP_INSTALLED_PRODUCT = NO;
31543154
SUPPORTED_PLATFORMS = "xrsimulator xros macosx iphonesimulator iphoneos appletvsimulator appletvos";
31553155
SUPPORTS_MACCATALYST = YES;
3156-
TVOS_DEPLOYMENT_TARGET = 9.0;
3156+
TVOS_DEPLOYMENT_TARGET = 11.0;
31573157
XROS_DEPLOYMENT_TARGET = 1.0;
31583158
};
31593159
name = Debug;

docs/README-ios.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
iOS
22
======
33

4-
Building the Simple DirectMedia Layer for iOS 9.0+
4+
Building the Simple DirectMedia Layer for iOS 11.0+
55
==============================================================================
66

7-
Requirements: macOS 10.9 or later and the iOS 9.0 or newer SDK.
7+
Please note that building SDL requires at least Xcode 12.2 and the iOS 14.2 SDK.
88

99
Instructions:
1010

@@ -185,9 +185,6 @@ Windows:
185185
Textures:
186186
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, and SDL_PIXELFORMAT_RGB24 pixel formats.
187187

188-
Loading Shared Objects:
189-
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_ios.h.
190-
191188

192189
Notes -- CoreBluetooth.framework
193190
==============================================================================
@@ -249,7 +246,7 @@ Note that if you are using main callbacks instead of a standard C main() functio
249246
Deploying to older versions of iOS
250247
==============================================================================
251248

252-
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
249+
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 11.0
253250

254251
In order to do that you need to download an older version of Xcode:
255252
https://developer.apple.com/download/more/?name=Xcode

docs/README-macos.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To build SDL using the command line, use the CMake build script:
1313
```bash
1414
mkdir build
1515
cd build
16-
cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11
16+
cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
1717
cmake --build .
1818
sudo cmake --install .
1919
```
@@ -25,15 +25,12 @@ You can also build SDL as a Universal library (a single binary for both
2525
```bash
2626
mkdir build
2727
cd build
28-
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11
28+
cmake .. "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
2929
cmake --build .
3030
sudo cmake --install .
3131
```
3232

33-
Please note that building SDL requires at least Xcode 12.2 and the 11.0 SDK.
34-
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
35-
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
36-
of SDL 2.24.0.
33+
Please note that building SDL requires at least Xcode 12.2 and the macOS 11.0 SDK.
3734

3835
To use the library once it's built, you essential have two possibilities:
3936
use the traditional autoconf/automake/make method, or use Xcode.

src/SDL_internal.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,18 @@
7878
#ifndef _DARWIN_C_SOURCE
7979
#define _DARWIN_C_SOURCE 1 // for memset_pattern4()
8080
#endif
81+
#include <Availability.h>
82+
83+
#ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
84+
#define __IPHONE_OS_VERSION_MAX_ALLOWED 0
85+
#endif
86+
#ifndef __APPLETV_OS_VERSION_MAX_ALLOWED
87+
#define __APPLETV_OS_VERSION_MAX_ALLOWED 0
88+
#endif
89+
#ifndef __MAC_OS_X_VERSION_MAX_ALLOWED
90+
#define __MAC_OS_X_VERSION_MAX_ALLOWED 0
8191
#endif
92+
#endif // SDL_PLATFORM_APPLE
8293

8394
#ifdef HAVE_SYS_TYPES_H
8495
#include <sys/types.h>

src/audio/coreaudio/SDL_coreaudio.m

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -467,31 +467,16 @@ static bool UpdateAudioSession(SDL_AudioDevice *device, bool open, bool allow_pl
467467
options |= AVAudioSessionCategoryOptionDuckOthers;
468468
}
469469

470-
if ([session respondsToSelector:@selector(setCategory:mode:options:error:)]) {
471-
if (![session.category isEqualToString:category] || session.categoryOptions != options) {
472-
// Stop the current session so we don't interrupt other application audio
473-
PauseAudioDevices();
474-
[session setActive:NO error:nil];
475-
session_active = false;
476-
477-
if (![session setCategory:category mode:mode options:options error:&err]) {
478-
NSString *desc = err.description;
479-
SDL_SetError("Could not set Audio Session category: %s", desc.UTF8String);
480-
return false;
481-
}
482-
}
483-
} else {
484-
if (![session.category isEqualToString:category]) {
485-
// Stop the current session so we don't interrupt other application audio
486-
PauseAudioDevices();
487-
[session setActive:NO error:nil];
488-
session_active = false;
489-
490-
if (![session setCategory:category error:&err]) {
491-
NSString *desc = err.description;
492-
SDL_SetError("Could not set Audio Session category: %s", desc.UTF8String);
493-
return false;
494-
}
470+
if (![session.category isEqualToString:category] || session.categoryOptions != options) {
471+
// Stop the current session so we don't interrupt other application audio
472+
PauseAudioDevices();
473+
[session setActive:NO error:nil];
474+
session_active = false;
475+
476+
if (![session setCategory:category mode:mode options:options error:&err]) {
477+
NSString *desc = err.description;
478+
SDL_SetError("Could not set Audio Session category: %s", desc.UTF8String);
479+
return false;
495480
}
496481
}
497482

src/dialog/cocoa/SDL_cocoadialog.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFil
146146
if (w) {
147147
// [dialog beginWithCompletionHandler:^(NSInteger result) {
148148
[dialog beginSheetModalForWindow:w completionHandler:^(NSInteger result) {
149-
// NSModalResponseOK for >= 10.13
150-
if (result == NSFileHandlingPanelOKButton) {
149+
if (result == NSModalResponseOK) {
151150
if (dialog_as_open) {
152151
NSArray* urls = [dialog_as_open URLs];
153152
const char *files[[urls count] + 1];
@@ -166,8 +165,7 @@ void SDL_SYS_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_DialogFil
166165
}
167166
}];
168167
} else {
169-
// NSModalResponseOK for >= 10.10
170-
if ([dialog runModal] == NSOKButton) {
168+
if ([dialog runModal] == NSModalResponseOK) {
171169
if (dialog_as_open) {
172170
NSArray* urls = [dialog_as_open URLs];
173171
const char *files[[urls count] + 1];

src/gpu/metal/SDL_gpu_metal.m

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,7 @@ static MTLTextureType SDLToMetal_TextureType(SDL_GPUTextureType textureType, boo
386386
case SDL_GPU_TEXTURETYPE_CUBE:
387387
return MTLTextureTypeCube;
388388
case SDL_GPU_TEXTURETYPE_CUBE_ARRAY:
389-
if (@available(iOS 11.0, tvOS 11.0, *)) {
390-
return MTLTextureTypeCubeArray;
391-
} else {
392-
return MTLTextureType2D; // FIXME: I guess...?
393-
}
389+
return MTLTextureTypeCubeArray;
394390
default:
395391
return MTLTextureType2D;
396392
}
@@ -1289,10 +1285,8 @@ static void METAL_InsertDebugLabel(
12891285
[metalCommandBuffer->computeEncoder insertDebugSignpost:label];
12901286
} else {
12911287
// Metal doesn't have insertDebugSignpost for command buffers...
1292-
if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
1293-
[metalCommandBuffer->handle pushDebugGroup:label];
1294-
[metalCommandBuffer->handle popDebugGroup];
1295-
}
1288+
[metalCommandBuffer->handle pushDebugGroup:label];
1289+
[metalCommandBuffer->handle popDebugGroup];
12961290
}
12971291
}
12981292
}
@@ -1312,9 +1306,7 @@ static void METAL_PushDebugGroup(
13121306
} else if (metalCommandBuffer->computeEncoder) {
13131307
[metalCommandBuffer->computeEncoder pushDebugGroup:label];
13141308
} else {
1315-
if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
1316-
[metalCommandBuffer->handle pushDebugGroup:label];
1317-
}
1309+
[metalCommandBuffer->handle pushDebugGroup:label];
13181310
}
13191311
}
13201312
}
@@ -1332,9 +1324,7 @@ static void METAL_PopDebugGroup(
13321324
} else if (metalCommandBuffer->computeEncoder) {
13331325
[metalCommandBuffer->computeEncoder popDebugGroup];
13341326
} else {
1335-
if (@available(macOS 10.13, iOS 11.0, tvOS 11.0, *)) {
1336-
[metalCommandBuffer->handle popDebugGroup];
1337-
}
1327+
[metalCommandBuffer->handle popDebugGroup];
13381328
}
13391329
}
13401330
}
@@ -2418,9 +2408,7 @@ static void METAL_BindGraphicsPipeline(
24182408
[metalCommandBuffer->renderEncoder setTriangleFillMode:SDLToMetal_PolygonMode[metalGraphicsPipeline->rasterizerState.fill_mode]];
24192409
[metalCommandBuffer->renderEncoder setCullMode:SDLToMetal_CullMode[metalGraphicsPipeline->rasterizerState.cull_mode]];
24202410
[metalCommandBuffer->renderEncoder setFrontFacingWinding:SDLToMetal_FrontFace[metalGraphicsPipeline->rasterizerState.front_face]];
2421-
if (@available(iOS 11.0, tvOS 11.0, *)) {
2422-
[metalCommandBuffer->renderEncoder setDepthClipMode:SDLToMetal_DepthClipMode(metalGraphicsPipeline->rasterizerState.enable_depth_clip)];
2423-
}
2411+
[metalCommandBuffer->renderEncoder setDepthClipMode:SDLToMetal_DepthClipMode(metalGraphicsPipeline->rasterizerState.enable_depth_clip)];
24242412
[metalCommandBuffer->renderEncoder
24252413
setDepthBias:((rast->enable_depth_bias) ? rast->depth_bias_constant_factor : 0)
24262414
slopeScale:((rast->enable_depth_bias) ? rast->depth_bias_slope_factor : 0)

src/hidapi/ios/hid.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central
398398
{
399399
switch ( central.state )
400400
{
401-
case CBCentralManagerStatePoweredOn:
401+
case CBManagerStatePoweredOn:
402402
{
403403
NSLog( @"CoreBluetooth BLE hardware is powered on and ready" );
404404

@@ -418,23 +418,23 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central
418418
break;
419419
}
420420

421-
case CBCentralManagerStatePoweredOff:
421+
case CBManagerStatePoweredOff:
422422
NSLog( @"CoreBluetooth BLE hardware is powered off" );
423423
break;
424424

425-
case CBCentralManagerStateUnauthorized:
425+
case CBManagerStateUnauthorized:
426426
NSLog( @"CoreBluetooth BLE state is unauthorized" );
427427
break;
428428

429-
case CBCentralManagerStateUnknown:
429+
case CBManagerStateUnknown:
430430
NSLog( @"CoreBluetooth BLE state is unknown" );
431431
break;
432432

433-
case CBCentralManagerStateUnsupported:
433+
case CBManagerStateUnsupported:
434434
NSLog( @"CoreBluetooth BLE hardware is unsupported on this platform" );
435435
break;
436436

437-
case CBCentralManagerStateResetting:
437+
case CBManagerStateResetting:
438438
NSLog( @"CoreBluetooth BLE manager is resetting" );
439439
break;
440440
}

0 commit comments

Comments
 (0)