Skip to content

Commit

Permalink
Use ld_classic when building with XCode 15
Browse files Browse the repository at this point in the history
XCode 15 toolchain breaks the compatibility for
macOS version older than 12
  • Loading branch information
crsib committed Apr 23, 2024
1 parent 3b1a1aa commit 1152f57
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,25 @@ set( _OPT "audacity_" )
# Our very own project
project( Audacity )

# XCode 14 no longer allows building unsigned binaries.
# So for the XCode 14 `-` is passed as the code sign identity, which stands for
# local signing. `--deep` is passed, because 3d party libraries are copied unsigned.
# XCODE_VERSION is defined only after the project() command

if( APPLE )
# XCode 14 no longer allows building unsigned binaries.
# So for the XCode 14 `-` is passed as the code sign identity, which stands for
# local signing. `--deep` is passed, because 3d party libraries are copied unsigned.
# XCODE_VERSION is defined only after the project() command
if (XCODE_VERSION VERSION_LESS 14)
set( CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" CACHE INTERNAL "" )
else()
set( CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" CACHE INTERNAL "" )
set( CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep -o linker-signed --timestamp" CACHE INTERNAL "")
endif()

# Xcode 15 breaks compatibility with macOS vesions older than 12
# https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
if (XCODE_VERSION VERSION_GREATER_EQUAL 15)
# link_libraries is guaranteed to set the flag for all
# linker invocations
link_libraries("-Wl,-ld_classic")
endif()
endif()

# Load our functions/macros
Expand Down

0 comments on commit 1152f57

Please sign in to comment.