Skip to content

Commit

Permalink
Update juce wrapper and target compile options
Browse files Browse the repository at this point in the history
  • Loading branch information
multivac61 committed Nov 18, 2023
1 parent 397f71f commit 64a7ca8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
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
22 changes: 9 additions & 13 deletions src/wrapper/clap-juce-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,19 @@ 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();
}

void showNativeMenu(Point<int> 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{};
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 64a7ca8

Please sign in to comment.