From ebc7802c082a310f3fd5b49f92115bbaccc5d15d Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 2 Dec 2020 19:43:34 +0100 Subject: [PATCH] Patch Win32 module loading to use Boost.Filesystem C++17's `` header still doesn't seem to work with winegcc. --- meson.build | 5 ----- src/wine-host/bridges/vst3.cpp | 2 ++ tools/patch-vst3-sdk.sh | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 8328465f..f25f8565 100644 --- a/meson.build +++ b/meson.build @@ -125,9 +125,6 @@ tomlplusplus_dep = subproject('tomlplusplus', version : '2.1.0').get_variable('t wine_threads_dep = declare_dependency(link_args : '-lpthread') xcb_dep = dependency('xcb') -# These are required for the VST3 SDK's module import system -# TODO: Statically link this on the ubuntu-18.04 build -native_filesystem_dep = declare_dependency(link_args : '-lstdc++fs') wine_ole32_dep = declare_dependency(link_args : '-lole32') # The SDK includes a comment pragma that would link to this on MSVC wine_shell32_dep = declare_dependency(link_args : '-lshell32') @@ -322,7 +319,6 @@ host_64bit_deps = [ ] if with_vst3 host_64bit_deps += [ - native_filesystem_dep, vst3_sdk_hosting_wine_64bit_dep, wine_ole32_dep, wine_shell32_dep, @@ -369,7 +365,6 @@ if with_bitbridge ] if with_vst3 host_32bit_deps += [ - native_filesystem_dep, vst3_sdk_hosting_wine_32bit_dep, wine_ole32_dep, wine_shell32_dep, diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index e6d29728..920f0f5a 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -16,6 +16,8 @@ #include "vst3.h" +#include "../boost-fix.h" + // TODO: Do something with this, I just wanted to get the build working // TODO: Check if this can load both regular Unix style paths with Wine. Oh and // check if it works at all. diff --git a/tools/patch-vst3-sdk.sh b/tools/patch-vst3-sdk.sh index 8caa7c99..5e712099 100755 --- a/tools/patch-vst3-sdk.sh +++ b/tools/patch-vst3-sdk.sh @@ -63,6 +63,13 @@ replace_char16 "using Converter = std::wstring_convert$/#include /' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp" +sed -i 's/^using namespace std\(::experimental\)\?;$/namespace filesystem = boost::filesystem;/' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp" +sed -i 's/\bfile_type::directory\b/file_type::directory_file/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp" +sed -i 's/\bp\.native ()/p.wstring ()/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp" + # Don't try adding `std::u8string` to an `std::vector`. MSVC # probably coerces them, but GCC doesn't sed -i 's/\bgeneric_u8string\b/generic_string/g' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"