Use separate plugin-cache for Apple/M1

Plugins on Apple can be multi-arch (Intel + ARM), or AUs may
be bridged by Rosetta.

A user can also run Intel binary of Ardour or M1 binary on
M1 CPUs on macOS. Each can see different plugins - notably
VST3 plugins that are Intel only can be scanned using the
Intel binary, but are later not available with the M1 build.
This commit is contained in:
Robin Gareus 2022-06-07 23:42:41 +02:00
parent b8c3f9342a
commit fac6d6bf98
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 17 additions and 1 deletions

View File

@ -418,7 +418,11 @@ discover_auv2 (CAComponentDescription& desc, std::vector<ARDOUR::AUv2Info>& rv,
static string
auv2_info_cache_dir ()
{
#ifdef __aarch64__
string dir = Glib::build_filename (ARDOUR::user_cache_directory (), "auv2-arm64");
#else
string dir = Glib::build_filename (ARDOUR::user_cache_directory (), "auv2");
#endif
/* if the directory doesn't exist, try to create it */
if (!Glib::file_test (dir, Glib::FILE_TEST_IS_DIR)) {
if (g_mkdir (dir.c_str (), 0700)) {

View File

@ -164,7 +164,11 @@ std::string PluginManager::vst3_scanner_bin_path = "";
# endif
#endif
#define AUV2_BLACKLIST "auv2_blacklist.txt"
#ifdef __aarch64__
# define AUV2_BLACKLIST "auv2_a64_blacklist.txt"
#else
# define AUV2_BLACKLIST "auv2_blacklist.txt"
#endif
PluginManager&
PluginManager::instance()
@ -1945,7 +1949,11 @@ void
PluginManager::clear_vst3_cache ()
{
#ifdef VST3_SUPPORT
# if defined __APPLE__ && defined __aarch64__
string dn = Glib::build_filename (ARDOUR::user_cache_directory(), "vst-arm64");
# else
string dn = Glib::build_filename (ARDOUR::user_cache_directory(), "vst");
# endif
vector<string> v3i_files;
find_files_matching_regex (v3i_files, dn, "\\.v3i$", false);
for (vector<string>::iterator i = v3i_files.begin(); i != v3i_files.end (); ++i) {

View File

@ -350,7 +350,11 @@ ARDOUR::module_path_vst3 (string const& path)
static string
vst3_info_cache_dir ()
{
#if defined __APPLE__ && defined __aarch64__
string dir = Glib::build_filename (ARDOUR::user_cache_directory (), "vst-arm64");
#else
string dir = Glib::build_filename (ARDOUR::user_cache_directory (), "vst");
#endif
/* if the directory doesn't exist, try to create it */
if (!Glib::file_test (dir, Glib::FILE_TEST_IS_DIR)) {
if (g_mkdir (dir.c_str (), 0700)) {