Skip to content

Commit

Permalink
Merge pull request #76394 from bruvzg/macos_1013
Browse files Browse the repository at this point in the history
[macOS] Bump min. version to 10.13, and remove deprecated code.
  • Loading branch information
akien-mga committed Apr 24, 2023
2 parents b5ddafc + fd3e7e2 commit 60a335b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
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

0 comments on commit 60a335b

Please sign in to comment.