Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Bump min. version to 10.13, and remove deprecated code. #76394

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions platform/macos/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def configure(env: "Environment"):
env.Append(CCFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"])
env.Append(LINKFLAGS=["-arch", "arm64", "-mmacosx-version-min=11.0"])
elif env["arch"] == "x86_64":
print("Building for macOS 10.12+.")
env.Append(ASFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.12"])
print("Building for macOS 10.13+.")
env.Append(ASFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])

env.Append(CCFLAGS=["-fobjc-arc"])

Expand Down
27 changes: 6 additions & 21 deletions platform/macos/godot_content_view.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,7 @@ - (id)init {
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
self.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft;

if (@available(macOS 10.13, *)) {
[self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]];
#if !defined(__aarch64__) // Do not build deprectead 10.13 code on ARM.
} else {
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
#endif
}
[self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]];
marked_text = [[NSMutableAttributedString alloc] init];
return self;
}
Expand Down Expand Up @@ -321,20 +315,11 @@ - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
Vector<String> files;
NSPasteboard *pboard = [sender draggingPasteboard];

if (@available(macOS 10.13, *)) {
NSArray *items = pboard.pasteboardItems;
for (NSPasteboardItem *item in items) {
NSString *url = [item stringForType:NSPasteboardTypeFileURL];
NSString *file = [NSURL URLWithString:url].path;
files.push_back(String::utf8([file UTF8String]));
}
#if !defined(__aarch64__) // Do not build deprectead 10.13 code on ARM.
} else {
NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
for (NSString *file in filenames) {
files.push_back(String::utf8([file UTF8String]));
}
#endif
NSArray *items = pboard.pasteboardItems;
for (NSPasteboardItem *item in items) {
NSString *url = [item stringForType:NSPasteboardTypeFileURL];
NSString *file = [NSURL URLWithString:url].path;
files.push_back(String::utf8([file UTF8String]));
}

Variant v = files;
Expand Down