Skip to content

Commit 192039b

Browse files
committed
build: Increment macOS deployment target to 10.15
1 parent 90f1425 commit 192039b

File tree

8 files changed

+35
-19
lines changed

8 files changed

+35
-19
lines changed

.github/scripts/build_macos.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pushd build
1010
# build; pipe output to render warnings neatly
1111
xcodebuild -configuration RelWithDebInfo \
1212
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
13+
-parallelizeTargets \
1314
2>&1 | xcbeautify --renderer github-actions
1415

1516
popd

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"binaryDir": "${sourceDir}/build",
8282
"cacheVariables": {
8383
"CMAKE_OSX_ARCHITECTURES": {"type": "STRING", "value": "x86_64;arm64"},
84-
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.13"},
84+
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.15"},
8585
"ARES_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{MACOS_CERTIFICATE_NAME}"},
8686
"ARES_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{MACOS_NOTARIZATION_TEAMID}"},
8787
"ENABLE_CCACHE": true,

cmake/common/osconfig.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
1111
set(CMAKE_CXX_EXTENSIONS FALSE)
1212
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
1313
if(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
14-
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
14+
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET OR ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL ""))
15+
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
16+
endif()
1517
endif()
1618
set(OS_MACOS TRUE)
1719
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")

cmake/finders/FindMoltenVK.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ if(MoltenVK_FOUND)
8787
endif()
8888
set_target_properties(
8989
MoltenVK::MoltenVK
90-
PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}" VERSION ${MoltenVK_VERSION}
90+
PROPERTIES
91+
INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}"
92+
VERSION ${MoltenVK_VERSION}
93+
MACOS_VERSION_REQUIRED 10.15
9194
)
9295
endif()
9396
endif()

cmake/finders/Findlibrashader.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ if(librashader_FOUND AND ARES_ENABLE_LIBRASHADER)
108108
if(NOT TARGET librashader::librashader)
109109
add_library(librashader::librashader UNKNOWN IMPORTED)
110110
set_property(TARGET librashader::librashader PROPERTY IMPORTED_LOCATION "${librashader_LIBRARY}")
111+
# cargo does not set the minimum version correctly in the dylib, so manually define librashader's actual system requirement
112+
set_property(TARGET librashader::librashader PROPERTY MACOS_VERSION_REQUIRED 10.15)
111113

112114
librashader_set_soname()
113115
set_target_properties(

cmake/finders/Findslang_shaders.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mark_as_advanced(slang_shaders_LOCATION)
5757
if(NOT TARGET libretro::slang_shaders)
5858
if(slang_shaders_LOCATION)
5959
add_library(slang_shaders INTERFACE)
60-
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}")
60+
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}" MACOS_VERSION_REQUIRED 10.15)
6161
add_library(libretro::slang_shaders ALIAS slang_shaders)
6262
endif()
6363
endif()

cmake/macos/helpers.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function(ares_configure_executable target)
2222
get_target_property(target_type ${target} TYPE)
2323

2424
if(target_type STREQUAL EXECUTABLE)
25-
2625
get_target_property(is_bundle ${target} MACOSX_BUNDLE)
2726
get_target_property(target_output_name ${target} OUTPUT_NAME)
2827
if(is_bundle)
@@ -109,10 +108,15 @@ function(_bundle_dependencies target)
109108
endforeach()
110109
cmake_path(IS_PREFIX system_library_path "${imported_location}" is_system_framework)
111110

111+
unset(_required_macos)
112+
get_target_property(_required_macos ${library} MACOS_VERSION_REQUIRED)
113+
112114
if(is_system_framework OR is_xcode_framework)
113115
continue()
114116
elseif(is_framework)
115117
file(REAL_PATH "../../.." library_location BASE_DIRECTORY "${imported_location}")
118+
elseif(_required_macos VERSION_GREATER CMAKE_OSX_DEPLOYMENT_TARGET)
119+
continue()
116120
elseif(NOT library_type STREQUAL "STATIC_LIBRARY")
117121
if(NOT imported_location MATCHES ".+\\.a")
118122
set(library_location "${imported_location}")

desktop-ui/cmake/os-macos.cmake

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,24 @@ endfunction()
6565
# Add slang-shaders as a post-build script so we don't have an exceedingly long "Copy Files" phase
6666
if(ARES_ENABLE_LIBRASHADER)
6767
if(TARGET libretro::slang_shaders)
68-
add_custom_command(
69-
OUTPUT
70-
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
71-
POST_BUILD
72-
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
73-
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
74-
COMMENT "Copying slang shaders to app bundle"
75-
)
76-
add_custom_target(
77-
bundled_shaders
78-
DEPENDS
79-
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
80-
)
81-
add_dependencies(desktop-ui bundled_shaders)
68+
get_target_property(_required_macos libretro::slang_shaders MACOS_VERSION_REQUIRED)
69+
if(_required_macos VERSION_LESS_EQUAL CMAKE_OSX_DEPLOYMENT_TARGET)
70+
add_custom_command(
71+
OUTPUT
72+
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
73+
POST_BUILD
74+
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
75+
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
76+
COMMENT "Copying slang shaders to app bundle"
77+
)
78+
add_custom_target(
79+
bundled_shaders
80+
DEPENDS
81+
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
82+
)
83+
add_dependencies(desktop-ui bundled_shaders)
84+
endif()
85+
unset(_required_macos)
8286
endif()
8387
endif()
8488

0 commit comments

Comments
 (0)