Patch Win32 module loading to use Boost.Filesystem

C++17's `<filesystem>` header still doesn't seem to work with winegcc.
This commit is contained in:
Robbert van der Helm
2020-12-02 19:43:34 +01:00
parent 0b462c034e
commit ebc7802c08
3 changed files with 9 additions and 5 deletions
-5
View File
@@ -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,
+2
View File
@@ -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.
+7
View File
@@ -63,6 +63,13 @@ replace_char16 "using Converter = std::wstring_convert<std::codecvt_utf8_utf16<c
# version here is trying to do something funky
sed -i 's/\b__MINGW32__\b/__NOPE__/g' "$sdk_directory/pluginterfaces/base/funknown.cpp"
# libstdc++fs doesn't work under Winelib, for whatever reason that might be.
# We'll patch the Win32 module loading to use Boost.Filesystem instead.
sed -i 's/^#include <\(experimental\/\)\?filesystem>$/#include <boost\/filesystem.hpp>/' "$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<std::string>`. 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"