mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Also patch pluginterfaces for winegcc compilation
This commit is contained in:
@@ -175,6 +175,14 @@ if with_vst3
|
||||
override_options : ['warning_level=0'],
|
||||
native : false,
|
||||
)
|
||||
vst3_pluginterfaces_wine = static_library(
|
||||
'pluginterfaces_wine',
|
||||
vst3.get_variable('pluginterfaces_sources'),
|
||||
cpp_args : vst3_compiler_options + vst3_wine_compiler_options,
|
||||
include_directories : vst3_include_dir,
|
||||
override_options : ['warning_level=0'],
|
||||
native : false,
|
||||
)
|
||||
else
|
||||
message('VST3 support has been disabled')
|
||||
endif
|
||||
|
||||
+23
-13
@@ -26,19 +26,7 @@ find "$sdk_directory" -type f \( -iname '*.h' -or -iname '*.cpp' \) -print0 |
|
||||
# Use the string manipulation functions from the C standard library
|
||||
sed -i 's/\bSMTG_OS_WINDOWS\b/0/g;s/\bSMTG_OS_LINUX\b/1/g' "$sdk_directory/base/source/fstring.cpp"
|
||||
sed -i 's/\bSMTG_OS_WINDOWS\b/0/g;s/\bSMTG_OS_LINUX\b/1/g' "$sdk_directory/pluginterfaces/base/fstrdefs.h"
|
||||
|
||||
# We'll need some careful replacements in the Linux definitions in `fstring.cpp`
|
||||
# to use `wchar_t` instead of `char16_t`.
|
||||
sed -i "s/^using ConverterFacet = std::codecvt_utf8_utf16<char16_t>;$/#ifdef __WINE__\\
|
||||
using ConverterFacet = std::codecvt_utf8_utf16<wchar_t>;\\
|
||||
#else\\
|
||||
\0\\
|
||||
#endif/" "$sdk_directory/base/source/fstring.cpp"
|
||||
sed -i "s/^using Converter = std::wstring_convert<ConverterFacet, char16_t>;$/#ifdef __WINE__\\
|
||||
using Converter = std::wstring_convert<ConverterFacet, wchar_t>;\\
|
||||
#else\\
|
||||
\0\\
|
||||
#endif/" "$sdk_directory/base/source/fstring.cpp"
|
||||
sed -i 's/\bSMTG_OS_WINDOWS\b/0/g;s/\bSMTG_OS_LINUX\b/1/g' "$sdk_directory/pluginterfaces/base/ustring.cpp"
|
||||
|
||||
# `Windows.h` expects `wchar_t`, and the above defines will cause us to use
|
||||
# `char16_t` for string literals. This replacement targets a very specific line,
|
||||
@@ -47,6 +35,28 @@ sed -i "s/^using Converter = std::wstring_convert<ConverterFacet, char16_t>;$/#i
|
||||
# `SMTG_OS_WINDOWS` with a 0 here.
|
||||
sed -i 's/^ #if 0$/ #if __WINE__/' "$sdk_directory/pluginterfaces/base/fstrdefs.h"
|
||||
|
||||
# We'll need some careful replacements in the Linux definitions in `fstring.cpp`
|
||||
# to use `wchar_t` instead of `char16_t`.
|
||||
replace_char16() {
|
||||
local needle=$1
|
||||
local filename=$2
|
||||
|
||||
wchar_version=${needle//char16_t/wchar_t}
|
||||
sed -i "s/^$needle$/#ifdef __WINE__\\
|
||||
$wchar_version\\
|
||||
#else\\
|
||||
\0\\
|
||||
#endif/" "$filename"
|
||||
}
|
||||
|
||||
replace_char16 "using ConverterFacet = std::codecvt_utf8_utf16<char16_t>;" "$sdk_directory/base/source/fstring.cpp"
|
||||
replace_char16 "using Converter = std::wstring_convert<ConverterFacet, char16_t>;" "$sdk_directory/base/source/fstring.cpp"
|
||||
replace_char16 "using Converter = std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>;" "$sdk_directory/pluginterfaces/base/ustring.cpp"
|
||||
|
||||
# The definitions of long doesn't match up between platforms, and the mingw
|
||||
# version here is trying to do something funky
|
||||
sed -i 's/\b__MINGW32__\b/__NOPE__/g' "$sdk_directory/pluginterfaces/base/funknown.cpp"
|
||||
|
||||
# Meson requires this program to output something, or else it will error out
|
||||
# when trying to encode the empty output
|
||||
echo "Successfully patched '$sdk_directory' for winegcc compatibility"
|
||||
|
||||
Reference in New Issue
Block a user