mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Replace Boost.Dll with our own function
Now we no longer rely on anything from Boost. Later we'll move the path detection to the very beginning of the plugin bridge initialization so it can be set from the coming chainloader libraries.
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
#include "../../common/utils.h"
|
||||
#include "../host-process.h"
|
||||
|
||||
// FIXME: This should be passed as an argument instead
|
||||
#include "../../common/linking.h"
|
||||
|
||||
/**
|
||||
* If the amount of lockable memory is below this, then we'll warn about it
|
||||
* during startup. Otherwise we may run into issues when mapping shared memory
|
||||
@@ -73,9 +76,8 @@ class PluginBridge {
|
||||
* @throw std::runtime_error Thrown when the Wine plugin host could not be
|
||||
* found, or if it could not locate and load a VST3 module.
|
||||
*/
|
||||
template <invocable_returning<TSockets,
|
||||
asio::io_context&,
|
||||
const PluginInfo&> F>
|
||||
template <
|
||||
invocable_returning<TSockets, asio::io_context&, const PluginInfo&> F>
|
||||
PluginBridge(PluginType plugin_type, F&& create_socket_instance)
|
||||
// This is still correct for VST3 plugins because we can configure an
|
||||
// entire directory (the module's bundle) at once
|
||||
|
||||
@@ -9,6 +9,7 @@ vst2_plugin_sources = files(
|
||||
'../common/logging/common.cpp',
|
||||
'../common/logging/vst2.cpp',
|
||||
'../common/audio-shm.cpp',
|
||||
'../common/linking.cpp',
|
||||
'../common/plugins.cpp',
|
||||
'../common/process.cpp',
|
||||
'../common/utils.cpp',
|
||||
@@ -80,6 +81,7 @@ vst3_plugin_sources = files(
|
||||
'../common/serialization/vst3/process-data.cpp',
|
||||
'../common/audio-shm.cpp',
|
||||
'../common/configuration.cpp',
|
||||
'../common/linking.cpp',
|
||||
'../common/plugins.cpp',
|
||||
'../common/process.cpp',
|
||||
'../common/utils.cpp',
|
||||
|
||||
+3
-20
@@ -19,7 +19,6 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <boost/dll/runtime_symbol_info.hpp>
|
||||
#include <sstream>
|
||||
|
||||
// Generated inside of the build directory
|
||||
@@ -28,6 +27,9 @@
|
||||
#include "../common/configuration.h"
|
||||
#include "../common/utils.h"
|
||||
|
||||
// FIXME: This should be passed as an argument instead
|
||||
#include "../common/linking.h"
|
||||
|
||||
namespace fs = ghc::filesystem;
|
||||
|
||||
// These functions are used to populate the fields in `PluginInfo`. See the
|
||||
@@ -271,25 +273,6 @@ std::variant<OverridenWinePrefix, fs::path, DefaultWinePrefix> find_wine_prefix(
|
||||
return dosdevices_dir->parent_path();
|
||||
}
|
||||
|
||||
fs::path get_this_file_location() {
|
||||
// HACK: Not sure why, but `boost::dll::this_line_location()` returns a path
|
||||
// starting with a double slash on some systems. I've seen this happen
|
||||
// on both Ubuntu 18.04 and 20.04, but not on Arch based distros.
|
||||
// Under Linux a path starting with two slashes is treated the same as
|
||||
// a path starting with only a single slash, but Wine will refuse to
|
||||
// load any files when the path starts with two slashes. The easiest
|
||||
// way to work around this if this happens is to just add another
|
||||
// leading slash and then normalize the path, since three or more
|
||||
// slashes will be coerced into a single slash.
|
||||
// FIXME: Replace Boost.Filesystem usage
|
||||
fs::path this_file = boost::dll::this_line_location().string();
|
||||
if (this_file.string().starts_with("//")) {
|
||||
this_file = ("/" / this_file).lexically_normal();
|
||||
}
|
||||
|
||||
return this_file;
|
||||
}
|
||||
|
||||
bool equals_case_insensitive(const std::string& a, const std::string& b) {
|
||||
return std::equal(a.begin(), a.end(), b.begin(),
|
||||
[](const char& a_char, const char& b_char) {
|
||||
|
||||
@@ -235,12 +235,6 @@ ghc::filesystem::path generate_group_endpoint(
|
||||
*/
|
||||
std::vector<ghc::filesystem::path> get_augmented_search_path();
|
||||
|
||||
/**
|
||||
* Return a path to this `.so` file. This can be used to find out from where
|
||||
* this link to or copy of `libyabridge-{vst2,vst3}.so` was loaded.
|
||||
*/
|
||||
ghc::filesystem::path get_this_file_location();
|
||||
|
||||
/**
|
||||
* Load the configuration that belongs to a copy of or symlink to
|
||||
* `libyabridge-{vst2,vst3}.so`. If no configuration file could be found then
|
||||
|
||||
Reference in New Issue
Block a user