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

Increase macOS system requirements to macOS 10.15 #1830

Merged
merged 2 commits into from
Feb 11, 2025
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
1 change: 1 addition & 0 deletions .github/scripts/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pushd build
# build; pipe output to render warnings neatly
xcodebuild -configuration RelWithDebInfo \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
-parallelizeTargets \
2>&1 | xcbeautify --renderer github-actions

popd
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_OSX_ARCHITECTURES": {"type": "STRING", "value": "x86_64;arm64"},
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.13"},
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.15"},
"ARES_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{MACOS_CERTIFICATE_NAME}"},
"ARES_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{MACOS_NOTARIZATION_TEAMID}"},
"ENABLE_CCACHE": true,
Expand Down
4 changes: 3 additions & 1 deletion cmake/common/osconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_CXX_EXTENSIONS FALSE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
if(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET OR ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL ""))
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
endif()
endif()
set(OS_MACOS TRUE)
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
Expand Down
5 changes: 4 additions & 1 deletion cmake/finders/FindMoltenVK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ if(MoltenVK_FOUND)
endif()
set_target_properties(
MoltenVK::MoltenVK
PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}" VERSION ${MoltenVK_VERSION}
PROPERTIES
INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}"
VERSION ${MoltenVK_VERSION}
MACOS_VERSION_REQUIRED 10.15
)
endif()
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/finders/Findlibrashader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ if(librashader_FOUND AND ARES_ENABLE_LIBRASHADER)
if(NOT TARGET librashader::librashader)
add_library(librashader::librashader UNKNOWN IMPORTED)
set_property(TARGET librashader::librashader PROPERTY IMPORTED_LOCATION "${librashader_LIBRARY}")
# cargo does not set the minimum version correctly in the dylib, so manually define librashader's actual system requirement
set_property(TARGET librashader::librashader PROPERTY MACOS_VERSION_REQUIRED 10.15)

librashader_set_soname()
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion cmake/finders/Findslang_shaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mark_as_advanced(slang_shaders_LOCATION)
if(NOT TARGET libretro::slang_shaders)
if(slang_shaders_LOCATION)
add_library(slang_shaders INTERFACE)
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}")
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}" MACOS_VERSION_REQUIRED 10.15)
add_library(libretro::slang_shaders ALIAS slang_shaders)
endif()
endif()
6 changes: 5 additions & 1 deletion cmake/macos/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function(ares_configure_executable target)
get_target_property(target_type ${target} TYPE)

if(target_type STREQUAL EXECUTABLE)

get_target_property(is_bundle ${target} MACOSX_BUNDLE)
get_target_property(target_output_name ${target} OUTPUT_NAME)
if(is_bundle)
Expand Down Expand Up @@ -109,10 +108,15 @@ function(_bundle_dependencies target)
endforeach()
cmake_path(IS_PREFIX system_library_path "${imported_location}" is_system_framework)

unset(_required_macos)
get_target_property(_required_macos ${library} MACOS_VERSION_REQUIRED)

if(is_system_framework OR is_xcode_framework)
continue()
elseif(is_framework)
file(REAL_PATH "../../.." library_location BASE_DIRECTORY "${imported_location}")
elseif(_required_macos VERSION_GREATER CMAKE_OSX_DEPLOYMENT_TARGET)
continue()
elseif(NOT library_type STREQUAL "STATIC_LIBRARY")
if(NOT imported_location MATCHES ".+\\.a")
set(library_location "${imported_location}")
Expand Down
32 changes: 18 additions & 14 deletions desktop-ui/cmake/os-macos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,24 @@ endfunction()
# Add slang-shaders as a post-build script so we don't have an exceedingly long "Copy Files" phase
if(ARES_ENABLE_LIBRASHADER)
if(TARGET libretro::slang_shaders)
add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
POST_BUILD
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
COMMENT "Copying slang shaders to app bundle"
)
add_custom_target(
bundled_shaders
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
)
add_dependencies(desktop-ui bundled_shaders)
get_target_property(_required_macos libretro::slang_shaders MACOS_VERSION_REQUIRED)
if(_required_macos VERSION_LESS_EQUAL CMAKE_OSX_DEPLOYMENT_TARGET)
add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
POST_BUILD
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
COMMENT "Copying slang shaders to app bundle"
)
add_custom_target(
bundled_shaders
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
)
add_dependencies(desktop-ui bundled_shaders)
endif()
unset(_required_macos)
endif()
endif()

Expand Down
4 changes: 2 additions & 2 deletions hiro/cocoa/action/menu-check-item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

-(void) activate {
menuCheckItem->state.checked = !menuCheckItem->state.checked;
auto state = menuCheckItem->state.checked ? NSOnState : NSOffState;
auto state = menuCheckItem->state.checked ? NSControlStateValueOn : NSControlStateValueOff;
[self setState:state];
menuCheckItem->doToggle();
}
Expand All @@ -34,7 +34,7 @@ auto pMenuCheckItem::destruct() -> void {
}

auto pMenuCheckItem::setChecked(bool checked) -> void {
auto state = checked ? NSOnState : NSOffState;
auto state = checked ? NSControlStateValueOn : NSControlStateValueOff;
[cocoaAction setState:state];
}

Expand Down
2 changes: 1 addition & 1 deletion hiro/cocoa/action/menu-radio-item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ auto pMenuRadioItem::setChecked() -> void {
if(auto object = weak.acquire()) {
if(auto self = object->self()) {
if(auto p = dynamic_cast<pMenuRadioItem*>(self)) {
auto state = this == p ? NSOnState : NSOffState;
auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff;
[p->cocoaAction setState:state];
}
}
Expand Down
2 changes: 1 addition & 1 deletion hiro/cocoa/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ auto NSMakeImage(image icon, u32 scaleWidth = 0, u32 scaleHeight = 0) -> NSImage
pixelsWide:icon.width() pixelsHigh:icon.height()
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES
isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
bitmapFormat:NSBitmapFormatAlphaNonpremultiplied
bytesPerRow:(4 * icon.width()) bitsPerPixel:32
];
memory::copy<u32>([bitmap bitmapData], icon.data(), icon.width() * icon.height());
Expand Down
2 changes: 1 addition & 1 deletion hiro/cocoa/widget/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[self setTarget:self];
[self setAction:@selector(activate:)];
//NSRoundedBezelStyle has a fixed height; which breaks both icons and larger/smaller text
[self setBezelStyle:NSRegularSquareBezelStyle];
[self setBezelStyle:NSBezelStyleFlexiblePush];
}
return self;
}
Expand Down
8 changes: 4 additions & 4 deletions hiro/cocoa/widget/check-button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

[self setTarget:self];
[self setAction:@selector(activate:)];
[self setBezelStyle:NSRegularSquareBezelStyle];
[self setButtonType:NSOnOffButton];
[self setBezelStyle:NSBezelStyleFlexiblePush];
[self setButtonType:NSButtonTypeOnOff];
}
return self;
}

-(IBAction) activate:(id)sender {
checkButton->state.checked = [self state] != NSOffState;
checkButton->state.checked = [self state] != NSControlStateValueOff;
checkButton->doToggle();
}

Expand Down Expand Up @@ -58,7 +58,7 @@ auto pCheckButton::setBordered(bool bordered) -> void {
}

auto pCheckButton::setChecked(bool checked) -> void {
[(CocoaCheckButton*)cocoaView setState:checked ? NSOnState : NSOffState];
[(CocoaCheckButton*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff];
}

auto pCheckButton::setGeometry(Geometry geometry) -> void {
Expand Down
6 changes: 3 additions & 3 deletions hiro/cocoa/widget/check-label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

[self setTarget:self];
[self setAction:@selector(activate:)];
[self setButtonType:NSSwitchButton];
[self setButtonType:NSButtonTypeSwitch];
}
return self;
}

-(IBAction) activate:(id)sender {
checkLabel->state.checked = [self state] != NSOffState;
checkLabel->state.checked = [self state] != NSControlStateValueOff;
checkLabel->doToggle();
}

Expand All @@ -40,7 +40,7 @@ auto pCheckLabel::minimumSize() const -> Size {
}

auto pCheckLabel::setChecked(bool checked) -> void {
[(CocoaCheckLabel*)cocoaView setState:checked ? NSOnState : NSOffState];
[(CocoaCheckLabel*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff];
}

auto pCheckLabel::setGeometry(Geometry geometry) -> void {
Expand Down
2 changes: 0 additions & 2 deletions hiro/cocoa/widget/horizontal-scroll-bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
auto& state = horizontalScrollBar->state;

switch([self hitPart]) {
case NSScrollerIncrementLine:
case NSScrollerIncrementPage:
if(state.position < state.length - 1) state.position++;
[self update];
break;

case NSScrollerDecrementLine:
case NSScrollerDecrementPage:
if(state.position) state.position--;
[self update];
Expand Down
6 changes: 3 additions & 3 deletions hiro/cocoa/widget/radio-button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

[self setTarget:self];
[self setAction:@selector(activate:)];
[self setBezelStyle:NSRegularSquareBezelStyle];
[self setButtonType:NSOnOffButton];
[self setBezelStyle:NSBezelStyleFlexiblePush];
[self setButtonType:NSButtonTypeOnOff];
}
return self;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ auto pRadioButton::setChecked() -> void {
if(auto object = weak.acquire()) {
if(auto self = object->self()) {
if(auto p = dynamic_cast<pRadioButton*>(self)) {
auto state = this == p ? NSOnState : NSOffState;
auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff;
[(CocoaRadioButton*)p->cocoaView setState:state];
}
}
Expand Down
4 changes: 2 additions & 2 deletions hiro/cocoa/widget/radio-label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[self setTarget:self];
[self setAction:@selector(activate:)];
[self setButtonType:NSRadioButton];
[self setButtonType:NSButtonTypeRadio];
}
return self;
}
Expand Down Expand Up @@ -60,7 +60,7 @@ auto pRadioLabel::setGroup(sGroup group) -> void {
if(auto object = weak.acquire()) {
if(auto self = object->self()) {
if(auto p = dynamic_cast<pRadioLabel*>(self)) {
auto state = p->state().checked ? NSOnState : NSOffState;
auto state = p->state().checked ? NSControlStateValueOn : NSControlStateValueOff;
[(CocoaRadioLabel*)p->cocoaView setState:state];
}
}
Expand Down
4 changes: 2 additions & 2 deletions hiro/cocoa/widget/table-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
if(self = [super initTextCell:@""]) {
tableView = &tableViewReference;
buttonCell = [[NSButtonCell alloc] initTextCell:@""];
[buttonCell setButtonType:NSSwitchButton];
[buttonCell setButtonType:NSButtonTypeSwitch];
[buttonCell setControlSize:NSControlSizeSmall];
[buttonCell setRefusesFirstResponder:YES];
[buttonCell setTarget:self];
Expand All @@ -222,7 +222,7 @@
if(auto tableViewCell = tableViewItem->cell([view columnAtPoint:frame.origin])) {
if(tableViewCell->state.checkable) {
[buttonCell setHighlighted:YES];
[buttonCell setState:(tableViewCell->state.checked ? NSOnState : NSOffState)];
[buttonCell setState:(tableViewCell->state.checked ? NSControlStateValueOn : NSControlStateValueOff)];
[buttonCell drawWithFrame:frame inView:view];
frame.origin.x += frame.size.height + 2;
frame.size.width -= frame.size.height + 2;
Expand Down
2 changes: 0 additions & 2 deletions hiro/cocoa/widget/vertical-scroll-bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
auto& state = verticalScrollBar->state;

switch([self hitPart]) {
case NSScrollerIncrementLine:
case NSScrollerIncrementPage:
if(state.position < state.length - 1) state.position++;
[self update];
break;

case NSScrollerDecrementLine:
case NSScrollerDecrementPage:
if(state.position) state.position--;
[self update];
Expand Down
9 changes: 9 additions & 0 deletions ruby/audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@
#endif

#if defined(AUDIO_OPENAL)
#if defined(__APPLE__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif

#include <ruby/audio/openal.cpp>

#if defined(__APPLE__)
#pragma clang diagnostic pop
#endif
#endif

#if defined(AUDIO_OSS)
Expand Down
9 changes: 9 additions & 0 deletions ruby/video/video.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#if defined(VIDEO_CGL)
#if defined(__APPLE__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif

#include <ruby/video/cgl.cpp>

#if defined(__APPLE__)
#pragma clang diagnostic pop
#endif
#endif

#if defined(VIDEO_DIRECT3D9)
Expand Down
Loading