diff --git a/cmake/ClapTargetHelpers.cmake b/cmake/ClapTargetHelpers.cmake index 943c249..e4beb19 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 "" diff --git a/src/wrapper/clap-juce-wrapper.cpp b/src/wrapper/clap-juce-wrapper.cpp index 65c8102..b4d5c30 100644 --- a/src/wrapper/clap-juce-wrapper.cpp +++ b/src/wrapper/clap-juce-wrapper.cpp @@ -173,7 +173,7 @@ class EditorContextMenu : public juce::HostProvidedContextMenu juce::PopupMenu getEquivalentPopupMenu() const override { - host.contextMenuPopulate(host.host(), &menuTarget, builder.builder()); + host.contextMenuPopulate(&menuTarget, builder.builder()); jassert(builder.menuStack.size() == 1); // one of the sub-menus has not been closed? return builder.menuStack.front(); @@ -181,11 +181,11 @@ class EditorContextMenu : public juce::HostProvidedContextMenu void showNativeMenu(Point pos) const override { - if (!host.contextMenuCanPopup(host.host())) + if (!host.contextMenuCanPopup()) return; // TODO: figure out screen index? - host.contextMenuPopup(host.host(), &menuTarget, 0, pos.x, pos.y); + host.contextMenuPopup(&menuTarget, 0, pos.x, pos.y); } clap_context_menu_target menuTarget{}; @@ -230,9 +230,7 @@ class EditorContextMenu : public juce::HostProvidedContextMenu item.text = juce::CharPointer_UTF8(entry->label); item.isEnabled = entry->is_enabled; item.action = [&host = this->host, target = *this->menuTarget, - id = entry->action_id] { - host.contextMenuPerform(host.host(), &target, id); - }; + id = entry->action_id] { host.contextMenuPerform(&target, id); }; currentMenu.addItem(item); } @@ -246,9 +244,7 @@ class EditorContextMenu : public juce::HostProvidedContextMenu item.isEnabled = entry->is_enabled; item.isTicked = entry->is_checked; item.action = [&host = this->host, target = *this->menuTarget, - id = entry->action_id] { - host.contextMenuPerform(host.host(), &target, id); - }; + id = entry->action_id] { host.contextMenuPerform(&target, id); }; currentMenu.addItem(item); } @@ -1018,17 +1014,17 @@ class ClapJuceWrapper : public clap::helpers::Plugin< return false; } - int noteNameCount() noexcept override + uint32_t noteNameCount() noexcept override { if (processorAsClapExtensions) - return processorAsClapExtensions->noteNameCount(); + return (uint32_t)processorAsClapExtensions->noteNameCount(); return 0; } - bool noteNameGet(int index, clap_note_name *noteName) noexcept override + bool noteNameGet(uint32_t index, clap_note_name *noteName) noexcept override { if (processorAsClapExtensions) - return processorAsClapExtensions->noteNameGet(index, noteName); + return processorAsClapExtensions->noteNameGet((int)index, noteName); return false; }