diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-06-17 11:46:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-17 11:46:23 -0400 |
| commit | 34c308ebdb219c8c3e5cdc5a1192db8a51ef0c44 (patch) | |
| tree | b4323eb1fe5ac13ca6e5227a10056779e9f35b01 /indra/cmake | |
| parent | dace31455ca4b382f94a03d3c7c244d805bd85fd (diff) | |
macOS 27 build fixes + transition to UTType for file pickers (#5937)
* Get the viewer building on macOS 27
* Strip -mmacosx-version-min when we're below an SDK supported version.
Substitutes an actual SDK supported minimum version.
* Move kIOMainPortDefault behind an SDK compatibility check.
* Update llwindowmacosx_iokit.h
* Update llwindowmacosx_iokit.h
Diffstat (limited to 'indra/cmake')
| -rw-r--r-- | indra/cmake/00-Common.cmake | 11 | ||||
| -rw-r--r-- | indra/cmake/Linking.cmake | 2 | ||||
| -rw-r--r-- | indra/cmake/Variables.cmake | 33 |
3 files changed, 45 insertions, 1 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 99ea22ab4b..72347446b9 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -18,6 +18,17 @@ include(Variables) # We go to some trouble to set LL_BUILD to the set of relevant compiler flags. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") + +if (DARWIN) + # LL_BUILD carries a literal -mmacosx-version-min=<ver> from + # viewer-build-variables. We derive the macOS deployment target in + # Variables.cmake (clamping up to the SDK's supported minimum when needed) + # and let CMAKE_OSX_DEPLOYMENT_TARGET emit the flag to both compiler and + # linker. Strip the verbatim flag here so it can't conflict with the + # clamped deployment target. + string(REGEX REPLACE "-mmacosx-version-min=[0-9.]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +endif (DARWIN) + # Given that, all the flags you see added below are flags NOT present in # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables. # Before adding new ones here, it's important to ask: can this flag really be diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 900a64e2dd..5d4e8d8634 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -77,6 +77,7 @@ else() find_library(COREAUDIO_LIBRARY CoreAudio) find_library(COREGRAPHICS_LIBRARY CoreGraphics) find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox) + find_library(UNIFORMTYPEIDENTIFIERS_LIBRARY UniformTypeIdentifiers) target_link_libraries( ll::oslibraries INTERFACE ${COCOA_LIBRARY} @@ -87,6 +88,7 @@ else() ${COREAUDIO_LIBRARY} ${AUDIOTOOLBOX_LIBRARY} ${COREGRAPHICS_LIBRARY} + ${UNIFORMTYPEIDENTIFIERS_LIBRARY} ) endif() diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 22c2156bb8..baa93bd128 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -144,7 +144,38 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}") - set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}" CACHE STRING "macOS Deploy Target" FORCE) + set(LL_REQUESTED_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") + + # Determine the lowest deployment target the active macOS SDK still supports. + # We aim for 11.0 in our public builds, but newer Xcode/SDK releases + # periodically raise this floor (e.g. Xcode 26 -> 13.3, Xcode 27 -> 14), and + # linking against a deployment target below the SDK's minimum fails. Read the + # supported minimum from the SDK and clamp our requested target up to it when + # necessary, so the build tracks whatever the SDK allows automatically. + set(LL_SDK_MINIMUM_DEPLOYMENT_TARGET "") + execute_process( + COMMAND xcrun --sdk macosx --show-sdk-path + OUTPUT_VARIABLE LL_MACOS_SDK_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + if (LL_MACOS_SDK_PATH AND EXISTS "${LL_MACOS_SDK_PATH}/SDKSettings.plist") + execute_process( + COMMAND /usr/libexec/PlistBuddy -c + "Print :SupportedTargets:macosx:MinimumDeploymentTarget" + "${LL_MACOS_SDK_PATH}/SDKSettings.plist" + OUTPUT_VARIABLE LL_SDK_MINIMUM_DEPLOYMENT_TARGET + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + endif () + + set(LL_EFFECTIVE_DEPLOYMENT_TARGET "${LL_REQUESTED_DEPLOYMENT_TARGET}") + if (LL_SDK_MINIMUM_DEPLOYMENT_TARGET AND + LL_REQUESTED_DEPLOYMENT_TARGET VERSION_LESS LL_SDK_MINIMUM_DEPLOYMENT_TARGET) + message(STATUS "Requested macOS deploy target ${LL_REQUESTED_DEPLOYMENT_TARGET} is below the SDK minimum ${LL_SDK_MINIMUM_DEPLOYMENT_TARGET}; clamping to ${LL_SDK_MINIMUM_DEPLOYMENT_TARGET}") + set(LL_EFFECTIVE_DEPLOYMENT_TARGET "${LL_SDK_MINIMUM_DEPLOYMENT_TARGET}") + endif () + + set(CMAKE_OSX_DEPLOYMENT_TARGET "${LL_EFFECTIVE_DEPLOYMENT_TARGET}" CACHE STRING "macOS Deploy Target" FORCE) message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") # Use dwarf symbols for most libraries for compilation speed |
