Skip to content

Commit

Permalink
More XCode 15 work (#138)
Browse files Browse the repository at this point in the history
* More XCode 15 work

- If xcode 15 (clang version 15 or greater) is active add link targets
  directly to the clap target
- Don't generator condition it; this is needed for ninja and others too

* - Complete move by removing prior setting which occasionally got
  wiped
- >= 15.0 and < 15.1 is the prescription for the compiler flags

* 10.13 xcode 15 handling

* no double comman
  • Loading branch information
baconpaul authored Nov 8, 2023
1 parent dd263ec commit 9ed8659
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ endif()
message( STATUS "Building CLAP with CLAP_CXX_STANDARD=${CLAP_CXX_STANDARD}")
set(CMAKE_CXX_EXTENSIONS OFF)

if(CMAKE_GENERATOR STREQUAL Xcode)
# Funky work around for Xcode 15, see: https://forum.juce.com/t/vst-au-builds-fail-after-upgrading-to-xcode-15/57936/43
message(STATUS "Configuring CJE with Xcode version ${XCODE_VERSION}")
if((${XCODE_VERSION} STREQUAL "15.0") OR (${XCODE_VERSION} STREQUAL "15.0.1"))
message(STATUS "Enabling Xcode 15 linker workaround!")
add_link_options("-Wl,-ld_classic")
add_compile_definitions(JUCE_SILENCE_XCODE_15_LINKER_WARNING=1)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment target" FORCE)
endif()
endif()

option(CLAP_JUCE_EXTENSIONS_BUILD_EXAMPLES "Add targets for building and running clap-juce-extensions examples" ${is_toplevel})
if(CLAP_JUCE_EXTENSIONS_BUILD_EXAMPLES)
Expand Down
11 changes: 11 additions & 0 deletions cmake/ClapTargetHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ function(clap_juce_extensions_plugin_internal)
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${cjd}/cmake/macos_bundle/clap.icns" "$<TARGET_FILE_DIR:${claptarget}>/../Resources"
VERBATIM
)

# Address the xcode linker juce issue
# see: https://forum.juce.com/t/vst-au-builds-fail-after-upgrading-to-xcode-15/57936/43
if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "15.0.0" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "15.1")
target_link_options(${claptarget} PUBLIC "-Wl,-ld_classic")
target_compile_definitions(${claptarget} PUBLIC JUCE_SILENCE_XCODE_15_LINKER_WARNING=TRUE)
if (${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS "10.13")
message(STATUS "Changing OSX Deployment Target from ${CMAKE_OSX_DEPLOYMENT_TARGET} to 10.13 for XCode 15")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment target" FORCE)
endif()
endif()
else()
set_target_properties(${claptarget} PROPERTIES
PREFIX ""
Expand Down

0 comments on commit 9ed8659

Please sign in to comment.