Merge pull request #22346 from hrydgard/macosx-fixes

MacOSX: Menubar fixes, compile warning fix
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-09-24 14:27:24 -06:00
commit 319fbedabf
3 files changed
+433 -547

No files matched your search

+2 -5
View File
@@ -510,11 +510,8 @@ if(NOT MSVC)
if(IOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
elseif(APPLE AND NOT CMAKE_CROSSCOMPILING)
if(LIBRETRO AND ARM64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
endif()
# The oldest libc++ in current Xcode supports ("The selected platform is no longer supported" below).
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>" -U__STRICT_ANSI__)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
elseif(NOT ANDROID)
+414 -521
View File
File diff suppressed because it is too large. Load diff
+17 -21
View File
@@ -57,29 +57,25 @@ void RunOnMainQueue(dispatch_block_t block) {
}
- (BOOL)ensurePermission {
if (@available(macOS 10.14, *)) {
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (status == AVAuthorizationStatusAuthorized) {
return YES;
}
if (status == AVAuthorizationStatusNotDetermined) {
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
(void)granted;
dispatch_semaphore_signal(sema);
}];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
}
if (status != AVAuthorizationStatusAuthorized) {
ERROR_LOG(Log::HLE, "Camera permission denied on macOS");
return NO;
}
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (status == AVAuthorizationStatusAuthorized) {
return YES;
}
// macOS < 10.14 does not require runtime permission checks.
if (status == AVAuthorizationStatusNotDetermined) {
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
(void)granted;
dispatch_semaphore_signal(sema);
}];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
}
if (status != AVAuthorizationStatusAuthorized) {
ERROR_LOG(Log::HLE, "Camera permission denied on macOS");
return NO;
}
return YES;
}