Browse Source

Use "plugins-OS-CPU" plugins dir on all arches. On x64, rename old "plugins" dir to new dir.

tags/v2.4.0
Andrew Belt 1 year ago
parent
commit
58d5c06ab7
2 changed files with 15 additions and 10 deletions
  1. +1
    -5
      plugin.mk
  2. +14
    -5
      src/plugin.cpp

+ 1
- 5
plugin.mk View File

@@ -48,11 +48,7 @@ ifdef ARCH_WIN
RACK_USER_DIR ?= $(USERPROFILE)/Documents/Rack2 RACK_USER_DIR ?= $(USERPROFILE)/Documents/Rack2
endif endif


PLUGINS_DIR := $(RACK_USER_DIR)/plugins
ifndef ARCH_X64
# On non-x64, append CPU name to plugins dir
PLUGINS_DIR := $(PLUGINS_DIR)-$(ARCH_CPU)
endif
PLUGINS_DIR := $(RACK_USER_DIR)/plugins-$(ARCH_OS)-$(ARCH_CPU)


DEP_FLAGS += -fPIC DEP_FLAGS += -fPIC
include $(RACK_DIR)/dep.mk include $(RACK_DIR)/dep.mk


+ 14
- 5
src/plugin.cpp View File

@@ -254,13 +254,22 @@ void init() {
loadPlugin(""); loadPlugin("");


// Get user plugins directory // Get user plugins directory
pluginsPath = asset::user("plugins");
// Use `plugins-CPU` dir on non-x64 platforms
#if !defined ARCH_X64
if (!settings::devMode) {
pluginsPath += "-" + APP_CPU;
if (settings::devMode) {
pluginsPath = asset::user("plugins");
}
else {
pluginsPath = asset::user("plugins-" + APP_OS + "-" + APP_CPU);
}

// In Rack <2.4.0, plugins dir was "plugins" regardless of arch.
// Rename old dir if running x64.
#if defined ARCH_X64
std::string oldPluginsPath = asset::user("plugins");
if (system::isDirectory(oldPluginsPath)) {
system::rename(oldPluginsPath, pluginsPath);
} }
#endif #endif

system::createDirectory(pluginsPath); system::createDirectory(pluginsPath);


// Don't load plugins if safe mode is enabled // Don't load plugins if safe mode is enabled


Loading…
Cancel
Save