1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Use macos-15-built libraries v40 (#24939)

* Use macos-15-built libraries v40

Windows version is the same as v38, no need to update

* Use macos-15 in CI

* Build libopenrct2 statically

* Skip creating universal libopenrct2.dylib as it no longer exists

* Force static linking on macOS
This commit is contained in:
Michał Janiszewski
2025-08-26 07:04:30 +02:00
committed by GitHub
parent be125fc9e1
commit 66665c8a81
4 changed files with 22 additions and 14 deletions

View File

@@ -404,7 +404,7 @@ jobs:
if: ${{matrix.run_tests}}
macos-universal:
name: macOS universal app bundle
runs-on: macos-14
runs-on: macos-15
needs: [macos-cmake, build_variables]
steps:
- name: Checkout

View File

@@ -142,9 +142,9 @@ if (MACOS_USE_DEPENDENCIES)
# if we're building on macOS, then we need the dependencies
include(cmake/download.cmake)
set(MACOS_DYLIBS_VERSION "38")
set(MACOS_DYLIBS_VERSION "40")
set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-universal-macos-dylibs.zip")
set(MACOS_DYLIBS_SHA256 "900f298be7bf2b8469d0b9f1700f09a61ded3daafea32f599d58c88b6d7c9ce7")
set(MACOS_DYLIBS_SHA256 "dfbdf2a2bb09cdf52e77b2a4ed3889845bb0203ae4cb6be4f2a161ebacc9b02f")
set(MACOS_DYLIBS_DIR "${ROOT_DIR}/lib/macos")
set(MACOS_DYLIBS_URL "https://github.com/OpenRCT2/Dependencies/releases/download/v${MACOS_DYLIBS_VERSION}/${MACOS_DYLIBS_ZIPFILE}")

View File

@@ -19,9 +19,8 @@ lipo -create x64/OpenRCT2.app/Contents/MacOS/OpenRCT2 arm64/OpenRCT2.app/Content
# copy frameworks
mkdir OpenRCT2-universal.app/Contents/Frameworks
# with the exception of libopenrct2.dylib, the Frameworks are identical and are already universal dylibs
rsync -ah --exclude 'libopenrct2.dylib' x64/OpenRCT2.app/Contents/Frameworks/* OpenRCT2-universal.app/Contents/Frameworks
lipo -create x64/OpenRCT2.app/Contents/Frameworks/libopenrct2.dylib arm64/OpenRCT2.app/Contents/Frameworks/libopenrct2.dylib -output OpenRCT2-universal.app/Contents/Frameworks/libopenrct2.dylib
# the Frameworks are identical and are already universal dylibs
rsync -ah x64/OpenRCT2.app/Contents/Frameworks/* OpenRCT2-universal.app/Contents/Frameworks
# handle Info.plist
defaults import $PWD/OpenRCT2-universal.app/Contents/Info $PWD/x64/OpenRCT2.app/Contents/Info.plist $PWD/arm64/OpenRCT2.app/Contents/Info.plist

View File

@@ -19,7 +19,16 @@ if (ENABLE_SCRIPTING)
endif ()
endif ()
add_library(libopenrct2 ${OPENRCT2_CORE_SOURCES} ${OPENRCT2_CORE_MM_SOURCES} ${OPENRCT2_DUKTAPE_SOURCES})
# On macOS the compiler computes typeids to different values in shared library and in the executable.
# This causes issues with RTTI and results in "bad any cast" exception getting thrown at runtime.
# It should be possible to expose relevant types with visibility default attribute, but we can make the whole issue go away by
# linking the library and executable statically. There is no openrct2-cli in macOS package, so no code gets duplicated.
# https://github.com/OpenRCT2/OpenRCT2/issues/24936
set(LIBOPENRCT2_LINKAGE)
if (APPLE)
set(LIBOPENRCT2_LINKAGE STATIC)
endif()
add_library(libopenrct2 ${LIBOPENRCT2_LINKAGE} ${OPENRCT2_CORE_SOURCES} ${OPENRCT2_CORE_MM_SOURCES} ${OPENRCT2_DUKTAPE_SOURCES})
add_library(OpenRCT2::libopenrct2 ALIAS libopenrct2)
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13")