mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Fix compiling VST3 module system with winegcc
This commit is contained in:
@@ -22,7 +22,8 @@ imcomplete list of things that still have to be done before this can be used:
|
|||||||
- Mention that this update will break all existing symlinks and that the old
|
- Mention that this update will break all existing symlinks and that the old
|
||||||
`libyabridge.so` file should be removed when upgrading.
|
`libyabridge.so` file should be removed when upgrading.
|
||||||
- Update all the AUR packages.
|
- Update all the AUR packages.
|
||||||
- Add CMake to the AUR package dependencies and to our Docker images
|
- Test the binaries built on GitHub on plain Ubuntu 18.04, are we missing any
|
||||||
|
static linking?
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
+110
-58
@@ -125,6 +125,12 @@ tomlplusplus_dep = subproject('tomlplusplus', version : '2.1.0').get_variable('t
|
|||||||
wine_threads_dep = declare_dependency(link_args : '-lpthread')
|
wine_threads_dep = declare_dependency(link_args : '-lpthread')
|
||||||
xcb_dep = dependency('xcb')
|
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')
|
||||||
|
wine_uuid_dep = declare_dependency(link_args : '-luuid')
|
||||||
|
|
||||||
include_dir = include_directories('src/include')
|
include_dir = include_directories('src/include')
|
||||||
|
|
||||||
if with_vst3
|
if with_vst3
|
||||||
@@ -192,7 +198,7 @@ if with_vst3
|
|||||||
vst3_base_wine = static_library(
|
vst3_base_wine = static_library(
|
||||||
'base_wine',
|
'base_wine',
|
||||||
vst3.get_variable('base_sources'),
|
vst3.get_variable('base_sources'),
|
||||||
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + [ '-Wno-cpp'],
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m64', '-Wno-cpp'],
|
||||||
include_directories : vst3_include_dir,
|
include_directories : vst3_include_dir,
|
||||||
override_options : ['warning_level=0'],
|
override_options : ['warning_level=0'],
|
||||||
native : false,
|
native : false,
|
||||||
@@ -200,7 +206,7 @@ if with_vst3
|
|||||||
vst3_pluginterfaces_wine = static_library(
|
vst3_pluginterfaces_wine = static_library(
|
||||||
'pluginterfaces_wine',
|
'pluginterfaces_wine',
|
||||||
vst3.get_variable('pluginterfaces_sources'),
|
vst3.get_variable('pluginterfaces_sources'),
|
||||||
cpp_args : vst3_compiler_options + vst3_wine_compiler_options,
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m64'],
|
||||||
include_directories : vst3_include_dir,
|
include_directories : vst3_include_dir,
|
||||||
override_options : ['warning_level=0'],
|
override_options : ['warning_level=0'],
|
||||||
native : false,
|
native : false,
|
||||||
@@ -209,7 +215,7 @@ if with_vst3
|
|||||||
'sdk_hosting_wine',
|
'sdk_hosting_wine',
|
||||||
vst3.get_variable('sdk_common_sources') + vst3.get_variable('sdk_hosting_sources'),
|
vst3.get_variable('sdk_common_sources') + vst3.get_variable('sdk_hosting_sources'),
|
||||||
link_with : [vst3_base_wine, vst3_pluginterfaces_wine],
|
link_with : [vst3_base_wine, vst3_pluginterfaces_wine],
|
||||||
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-Wno-multichar'],
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m64', '-Wno-multichar'],
|
||||||
include_directories : vst3_include_dir,
|
include_directories : vst3_include_dir,
|
||||||
override_options : ['warning_level=0'],
|
override_options : ['warning_level=0'],
|
||||||
native : false,
|
native : false,
|
||||||
@@ -217,8 +223,48 @@ if with_vst3
|
|||||||
vst3_sdk_hosting_wine_dep = declare_dependency(
|
vst3_sdk_hosting_wine_dep = declare_dependency(
|
||||||
link_with : vst3_sdk_hosting_wine,
|
link_with : vst3_sdk_hosting_wine,
|
||||||
include_directories : vst3_include_dir,
|
include_directories : vst3_include_dir,
|
||||||
|
# This does mean that we now have a lot of defines in our code, but the
|
||||||
|
# alternative would be patching every location in the SDK where they include
|
||||||
|
# `windows.h`
|
||||||
compile_args : vst3_wine_compiler_options,
|
compile_args : vst3_wine_compiler_options,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# And another time for the 32-bit version
|
||||||
|
if with_bitbridge
|
||||||
|
vst3_base_wine_32 = static_library(
|
||||||
|
'base_wine_32',
|
||||||
|
vst3.get_variable('base_sources'),
|
||||||
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m32', '-Wno-cpp'],
|
||||||
|
include_directories : vst3_include_dir,
|
||||||
|
override_options : ['warning_level=0'],
|
||||||
|
native : false,
|
||||||
|
)
|
||||||
|
vst3_pluginterfaces_wine_32 = static_library(
|
||||||
|
'pluginterfaces_wine_32',
|
||||||
|
vst3.get_variable('pluginterfaces_sources'),
|
||||||
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m32'],
|
||||||
|
include_directories : vst3_include_dir,
|
||||||
|
override_options : ['warning_level=0'],
|
||||||
|
native : false,
|
||||||
|
)
|
||||||
|
vst3_sdk_hosting_wine_32 = static_library(
|
||||||
|
'sdk_hosting_wine_32',
|
||||||
|
vst3.get_variable('sdk_common_sources') + vst3.get_variable('sdk_hosting_sources'),
|
||||||
|
link_with : [vst3_base_wine_32, vst3_pluginterfaces_wine_32],
|
||||||
|
cpp_args : vst3_compiler_options + vst3_wine_compiler_options + ['-m32', '-Wno-multichar'],
|
||||||
|
include_directories : vst3_include_dir,
|
||||||
|
override_options : ['warning_level=0'],
|
||||||
|
native : false,
|
||||||
|
)
|
||||||
|
vst3_sdk_hosting_wine_32_dep = declare_dependency(
|
||||||
|
link_with : vst3_sdk_hosting_wine_32,
|
||||||
|
include_directories : vst3_include_dir,
|
||||||
|
# This does mean that we now have a lot of defines in our code, but the
|
||||||
|
# alternative would be patching every location in the SDK where they include
|
||||||
|
# `windows.h`
|
||||||
|
compile_args : vst3_wine_compiler_options,
|
||||||
|
)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# The application consists of a plugin (`libyabridge-{vst2,vst3}.so`) that calls
|
# The application consists of a plugin (`libyabridge-{vst2,vst3}.so`) that calls
|
||||||
@@ -263,41 +309,23 @@ if with_vst3
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
executable(
|
host_deps = [
|
||||||
individual_host_name_64bit,
|
boost_dep,
|
||||||
individual_host_sources,
|
boost_filesystem_dep,
|
||||||
native : false,
|
bitsery_dep,
|
||||||
include_directories : include_dir,
|
function2_dep,
|
||||||
dependencies : [
|
tomlplusplus_dep,
|
||||||
boost_dep,
|
wine_threads_dep,
|
||||||
boost_filesystem_dep,
|
xcb_dep,
|
||||||
bitsery_dep,
|
]
|
||||||
function2_dep,
|
if with_vst3
|
||||||
tomlplusplus_dep,
|
host_deps += [
|
||||||
wine_threads_dep,
|
native_filesystem_dep,
|
||||||
xcb_dep,
|
vst3_sdk_hosting_wine_dep,
|
||||||
],
|
wine_ole32_dep,
|
||||||
cpp_args : compiler_options + ['-m64'],
|
wine_uuid_dep,
|
||||||
link_args : ['-m64'],
|
]
|
||||||
)
|
endif
|
||||||
|
|
||||||
executable(
|
|
||||||
group_host_name_64bit,
|
|
||||||
group_host_sources,
|
|
||||||
native : false,
|
|
||||||
include_directories : include_dir,
|
|
||||||
dependencies : [
|
|
||||||
boost_dep,
|
|
||||||
boost_filesystem_dep,
|
|
||||||
bitsery_dep,
|
|
||||||
function2_dep,
|
|
||||||
tomlplusplus_dep,
|
|
||||||
wine_threads_dep,
|
|
||||||
xcb_dep,
|
|
||||||
],
|
|
||||||
cpp_args : compiler_options + ['-m64'],
|
|
||||||
link_args : ['-m64'],
|
|
||||||
)
|
|
||||||
|
|
||||||
if with_bitbridge
|
if with_bitbridge
|
||||||
message('Bitbridge enabled, configuring a 32-bit host application')
|
message('Bitbridge enabled, configuring a 32-bit host application')
|
||||||
@@ -308,7 +336,7 @@ if with_bitbridge
|
|||||||
# search path set by the system in `find_library()`. If anyone does know how
|
# search path set by the system in `find_library()`. If anyone does know how
|
||||||
# to properly do this, please let me know!
|
# to properly do this, please let me know!
|
||||||
winegcc = meson.get_compiler('cpp', native : false)
|
winegcc = meson.get_compiler('cpp', native : false)
|
||||||
boost_filesystem_dep = winegcc.find_library(
|
boost_filesystem_32_dep = winegcc.find_library(
|
||||||
'boost_filesystem',
|
'boost_filesystem',
|
||||||
static : with_static_boost,
|
static : with_static_boost,
|
||||||
dirs : [
|
dirs : [
|
||||||
@@ -325,22 +353,54 @@ if with_bitbridge
|
|||||||
'/usr/lib',
|
'/usr/lib',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
xcb_dep = winegcc.find_library('xcb')
|
xcb_32_dep = winegcc.find_library('xcb')
|
||||||
|
|
||||||
|
host_32_deps = [
|
||||||
|
boost_dep,
|
||||||
|
boost_filesystem_32_dep,
|
||||||
|
bitsery_dep,
|
||||||
|
function2_dep,
|
||||||
|
tomlplusplus_dep,
|
||||||
|
wine_threads_dep,
|
||||||
|
xcb_32_dep,
|
||||||
|
]
|
||||||
|
if with_vst3
|
||||||
|
host_32_deps += [
|
||||||
|
native_filesystem_dep,
|
||||||
|
vst3_sdk_hosting_wine_32_dep,
|
||||||
|
wine_ole32_dep,
|
||||||
|
wine_uuid_dep,
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
executable(
|
||||||
|
individual_host_name_64bit,
|
||||||
|
individual_host_sources,
|
||||||
|
native : false,
|
||||||
|
include_directories : include_dir,
|
||||||
|
dependencies : host_deps,
|
||||||
|
cpp_args : compiler_options + ['-m64'],
|
||||||
|
link_args : ['-m64'],
|
||||||
|
)
|
||||||
|
|
||||||
|
executable(
|
||||||
|
group_host_name_64bit,
|
||||||
|
group_host_sources,
|
||||||
|
native : false,
|
||||||
|
include_directories : include_dir,
|
||||||
|
dependencies : host_deps,
|
||||||
|
cpp_args : compiler_options + ['-m64'],
|
||||||
|
link_args : ['-m64'],
|
||||||
|
)
|
||||||
|
|
||||||
|
if with_bitbridge
|
||||||
executable(
|
executable(
|
||||||
individual_host_name_32bit,
|
individual_host_name_32bit,
|
||||||
individual_host_sources,
|
individual_host_sources,
|
||||||
native : false,
|
native : false,
|
||||||
include_directories : include_dir,
|
include_directories : include_dir,
|
||||||
dependencies : [
|
dependencies : host_32_deps,
|
||||||
boost_dep,
|
|
||||||
boost_filesystem_dep,
|
|
||||||
bitsery_dep,
|
|
||||||
function2_dep,
|
|
||||||
tomlplusplus_dep,
|
|
||||||
wine_threads_dep,
|
|
||||||
xcb_dep,
|
|
||||||
],
|
|
||||||
cpp_args : compiler_options + ['-m32'],
|
cpp_args : compiler_options + ['-m32'],
|
||||||
link_args : ['-m32'],
|
link_args : ['-m32'],
|
||||||
)
|
)
|
||||||
@@ -350,15 +410,7 @@ if with_bitbridge
|
|||||||
group_host_sources,
|
group_host_sources,
|
||||||
native : false,
|
native : false,
|
||||||
include_directories : include_dir,
|
include_directories : include_dir,
|
||||||
dependencies : [
|
dependencies : host_32_deps,
|
||||||
boost_dep,
|
|
||||||
boost_filesystem_dep,
|
|
||||||
bitsery_dep,
|
|
||||||
function2_dep,
|
|
||||||
tomlplusplus_dep,
|
|
||||||
wine_threads_dep,
|
|
||||||
xcb_dep,
|
|
||||||
],
|
|
||||||
cpp_args : compiler_options + ['-m32'],
|
cpp_args : compiler_options + ['-m32'],
|
||||||
link_args : ['-m32'],
|
link_args : ['-m32'],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -70,7 +70,11 @@ sed -i 's/^#if defined(_MSC_VER) && .\+$/#if __WINE__/' "$sdk_directory/public.s
|
|||||||
|
|
||||||
# Use the proper `<filesystem>` header instead of the experimental one
|
# Use the proper `<filesystem>` header instead of the experimental one
|
||||||
# TODO: Check if <filesystem> now works with Winelib, or replace with Boost
|
# TODO: Check if <filesystem> now works with Winelib, or replace with Boost
|
||||||
sed -i 's/^#if _HAS_CXX17 && defined(_MSC_VER)$/#if 1/' "$sdk_directory/public.sdk/source/vst/hosting/module_win32.cpp"
|
# sed -i 's/^#if _HAS_CXX17 && defined(_MSC_VER)$/#if 1/' "$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"
|
||||||
|
|
||||||
# Meson requires this program to output something, or else it will error out
|
# Meson requires this program to output something, or else it will error out
|
||||||
# when trying to encode the empty output
|
# when trying to encode the empty output
|
||||||
|
|||||||
Reference in New Issue
Block a user