diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a31aac..d269fab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/ClapTargetHelpers.cmake b/cmake/ClapTargetHelpers.cmake index 07f8483..f24c583 100644 --- a/cmake/ClapTargetHelpers.cmake +++ b/cmake/ClapTargetHelpers.cmake @@ -114,6 +114,17 @@ function(clap_juce_extensions_plugin_internal) COMMAND ${CMAKE_COMMAND} -E copy_if_different "${cjd}/cmake/macos_bundle/clap.icns" "$/../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 ""