Skip to content

Commit a76aaf3

Browse files
committed
Fix plugin building on CI
1 parent 3c0f2a3 commit a76aaf3

3 files changed

Lines changed: 32 additions & 23 deletions

File tree

cmake/yup_audio_plugin.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ function (yup_audio_plugin)
164164
MACOSX_BUNDLE TRUE
165165
MACOSX_BUNDLE_BUNDLE_NAME "${target_name}_clap_plugin"
166166
MACOSX_BUNDLE_GUI_IDENTIFIER "${target_bundle_id}.clap"
167+
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${target_bundle_id}.clap"
167168
PREFIX "")
168169

169170
set (clap_plugin_path "$<TARGET_BUNDLE_DIR:${target_name}_clap_plugin>")
@@ -247,9 +248,13 @@ function (yup_audio_plugin)
247248
smtg_target_set_bundle (${target_name}_vst3_plugin
248249
BUNDLE_IDENTIFIER "${target_bundle_id}"
249250
COMPANY_NAME "kunitoki") # TODO - make company name configurable
250-
if ("${vst3_plugin_package_path}" STREQUAL "${vst3_plugin_binary_path}")
251+
252+
if (XCODE)
253+
get_target_property (vst3_plugin_package_path ${target_name}_vst3_plugin SMTG_PLUGIN_PACKAGE_PATH)
254+
else()
251255
set (vst3_plugin_package_path "$<TARGET_BUNDLE_DIR:${target_name}_vst3_plugin>")
252256
endif()
257+
253258
set (vst3_pluginval_path "${vst3_plugin_package_path}")
254259
endif()
255260
yup_validate_smtg_vst3_plugin (${target_name}_vst3_plugin "${vst3_plugin_package_path}")
@@ -475,9 +480,13 @@ function (yup_audio_plugin_copy_bundle target_name plugin_type)
475480
COMMENT "Symlinking CLAP plugin ${plugin_type_upper} plugin to ${plugin_path}"
476481
VERBATIM)
477482
elseif ("${plugin_type}" STREQUAL "vst3")
478-
get_target_property (source_plugin_path ${dependency_target} SMTG_PLUGIN_PACKAGE_PATH)
479-
if (NOT source_plugin_path)
483+
if (YUP_PLATFORM_MAC AND NOT XCODE)
480484
set (source_plugin_path "$<TARGET_BUNDLE_DIR:${dependency_target}>")
485+
else()
486+
get_target_property (source_plugin_path ${dependency_target} SMTG_PLUGIN_PACKAGE_PATH)
487+
if (NOT source_plugin_path)
488+
set (source_plugin_path "$<TARGET_BUNDLE_DIR:${dependency_target}>")
489+
endif()
481490
endif()
482491

483492
add_custom_command(TARGET ${dependency_target} POST_BUILD

examples/plugin/source/ExampleEditor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ ExampleEditor::ExampleEditor (ExamplePlugin& processor)
4545
{
4646
gainParameter->beginChangeGesture();
4747
};
48-
x->onValueChanged = [this] (float value)
48+
x->onValueChanged = [this] (double value)
4949
{
50-
gainParameter->setValueNotifyingHost (value);
50+
gainParameter->setValueNotifyingHost (static_cast<float> (value));
5151
};
5252
x->onDragEnd = [this] (const yup::MouseEvent&)
5353
{

modules/yup_audio_plugin_client/clap/yup_audio_plugin_client_CLAP.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,26 +1343,26 @@ static const clap_plugin_factory_t plugin_factory = []
13431343

13441344
//==============================================================================
13451345

1346-
extern "C" const CLAP_EXPORT clap_plugin_entry_t clap_entry = []
1346+
static bool clapInit (const char*) noexcept
13471347
{
1348-
clap_plugin_entry_t plugin;
1349-
1350-
plugin.clap_version = CLAP_VERSION_INIT;
1351-
1352-
plugin.init = [] (const char*) -> bool
1353-
{
1354-
return true;
1355-
};
1348+
return true;
1349+
}
13561350

1357-
plugin.deinit = [] {};
1351+
static void clapDeinit() noexcept
1352+
{
1353+
}
13581354

1359-
plugin.get_factory = [] (const char* factoryId) -> const void*
1360-
{
1361-
if (std::string_view (factoryId) == CLAP_PLUGIN_FACTORY_ID)
1362-
return std::addressof (plugin_factory);
1355+
static const void* clapGetFactory (const char* factoryId) noexcept
1356+
{
1357+
if (std::string_view (factoryId) == CLAP_PLUGIN_FACTORY_ID)
1358+
return std::addressof (plugin_factory);
13631359

1364-
return nullptr;
1365-
};
1360+
return nullptr;
1361+
}
13661362

1367-
return plugin;
1368-
}();
1363+
extern "C" const CLAP_EXPORT clap_plugin_entry_t clap_entry = {
1364+
CLAP_VERSION_INIT,
1365+
clapInit,
1366+
clapDeinit,
1367+
clapGetFactory
1368+
};

0 commit comments

Comments
 (0)