Merge pull request #82458 from bruvzg/ios_build_fix

[iOS] Fix build with Xcode 15.
This commit is contained in:
Rémi Verschelde 2023-09-30 11:02:17 +02:00
commit c9527516e3
No known key found for this signature in database
GPG key ID: C3336907360768E1
5 changed files with 23 additions and 29 deletions

View file

@ -254,8 +254,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
OTHER_LDFLAGS = "$linker_flags"; OTHER_LDFLAGS = "-ld_classic $linker_flags";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "$targeted_device_family"; TARGETED_DEVICE_FAMILY = "$targeted_device_family";
}; };
@ -293,8 +293,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
OTHER_LDFLAGS = "$linker_flags"; OTHER_LDFLAGS = "-ld_classic $linker_flags";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "$targeted_device_family"; TARGETED_DEVICE_FAMILY = "$targeted_device_family";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
@ -314,7 +314,7 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
DEVELOPMENT_TEAM = $team_id; DEVELOPMENT_TEAM = $team_id;
INFOPLIST_FILE = "$binary/$binary-Info.plist"; INFOPLIST_FILE = "$binary/$binary-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -350,7 +350,7 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
DEVELOPMENT_TEAM = $team_id; DEVELOPMENT_TEAM = $team_id;
INFOPLIST_FILE = "$binary/$binary-Info.plist"; INFOPLIST_FILE = "$binary/$binary-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

View file

@ -103,13 +103,13 @@ def configure(env: "Environment"):
if env["ios_simulator"]: if env["ios_simulator"]:
detect_darwin_sdk_path("iossimulator", env) detect_darwin_sdk_path("iossimulator", env)
env.Append(ASFLAGS=["-mios-simulator-version-min=11.0"]) env.Append(ASFLAGS=["-mios-simulator-version-min=12.0"])
env.Append(CCFLAGS=["-mios-simulator-version-min=11.0"]) env.Append(CCFLAGS=["-mios-simulator-version-min=12.0"])
env.extra_suffix = ".simulator" + env.extra_suffix env.extra_suffix = ".simulator" + env.extra_suffix
else: else:
detect_darwin_sdk_path("ios", env) detect_darwin_sdk_path("ios", env)
env.Append(ASFLAGS=["-miphoneos-version-min=11.0"]) env.Append(ASFLAGS=["-miphoneos-version-min=12.0"])
env.Append(CCFLAGS=["-miphoneos-version-min=11.0"]) env.Append(CCFLAGS=["-miphoneos-version-min=12.0"])
if env["arch"] == "x86_64": if env["arch"] == "x86_64":
if not env["ios_simulator"]: if not env["ios_simulator"]:
@ -154,7 +154,7 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["VULKAN_ENABLED"]) env.Append(CPPDEFINES=["VULKAN_ENABLED"])
if env["opengl3"]: if env["opengl3"]:
env.Append(CPPDEFINES=["GLES3_ENABLED"]) env.Append(CPPDEFINES=["GLES3_ENABLED", "GLES_SILENCE_DEPRECATION"])
env.Prepend( env.Prepend(
CPPPATH=[ CPPPATH=[
"$IOS_SDK_PATH/System/Library/Frameworks/OpenGLES.framework/Headers", "$IOS_SDK_PATH/System/Library/Frameworks/OpenGLES.framework/Headers",

View file

@ -371,19 +371,15 @@ bool DisplayServerIOS::is_dark_mode() const {
} }
Rect2i DisplayServerIOS::get_display_safe_area() const { Rect2i DisplayServerIOS::get_display_safe_area() const {
if (@available(iOS 11, *)) { UIEdgeInsets insets = UIEdgeInsetsZero;
UIEdgeInsets insets = UIEdgeInsetsZero; UIView *view = AppDelegate.viewController.godotView;
UIView *view = AppDelegate.viewController.godotView; if ([view respondsToSelector:@selector(safeAreaInsets)]) {
if ([view respondsToSelector:@selector(safeAreaInsets)]) { insets = [view safeAreaInsets];
insets = [view safeAreaInsets];
}
float scale = screen_get_scale();
Size2i insets_position = Size2i(insets.left, insets.top) * scale;
Size2i insets_size = Size2i(insets.left + insets.right, insets.top + insets.bottom) * scale;
return Rect2i(screen_get_position() + insets_position, screen_get_size() - insets_size);
} else {
return Rect2i(screen_get_position(), screen_get_size());
} }
float scale = screen_get_scale();
Size2i insets_position = Size2i(insets.left, insets.top) * scale;
Size2i insets_size = Size2i(insets.left + insets.right, insets.top + insets.bottom) * scale;
return Rect2i(screen_get_position() + insets_position, screen_get_size() - insets_size);
} }
int DisplayServerIOS::get_screen_count() const { int DisplayServerIOS::get_screen_count() const {

View file

@ -82,10 +82,10 @@ static const float earth_gravity = 9.80665;
layer = [GodotMetalLayer layer]; layer = [GodotMetalLayer layer];
#endif #endif
} else if ([driverName isEqualToString:@"opengl3"]) { } else if ([driverName isEqualToString:@"opengl3"]) {
if (@available(iOS 13, *)) { #pragma clang diagnostic push
NSLog(@"OpenGL ES is deprecated on iOS 13"); #pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in iOS 12.0
}
layer = [GodotOpenGLLayer layer]; layer = [GodotOpenGLLayer layer];
#pragma clang diagnostic pop
} else { } else {
return nil; return nil;
} }

View file

@ -161,9 +161,7 @@
[self observeKeyboard]; [self observeKeyboard];
[self displayLoadingOverlay]; [self displayLoadingOverlay];
if (@available(iOS 11.0, *)) { [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
} }
- (void)observeKeyboard { - (void)observeKeyboard {