Skip to content

Commit

Permalink
build: Increment macOS deployment target to 10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jcm93 committed Feb 11, 2025
1 parent 90f1425 commit 192039b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 19 deletions.
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

0 comments on commit 192039b

Please sign in to comment.