diff --git a/CHANGELOG.md b/CHANGELOG.md index 568869da..3d76decb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). can use both 32-bit and 64-bit Windows VST2 and VST3 plugins under 32-bit Linux plugin hosts. This should not be necessary in any normal situation since Desktop Linux has been 64-bit only for a while now, but it could be useful in - some very specific situations. + some very specific situations. Building on a real 32-bit system will also + work, in which case the 64-bit Wine plugin host applications simply won't be + built. - Defined the deprecated pre-VST2.4 `main` entry point for VST2 plugins. This allows the above mentioned 32-bit version of yabridge to be used in **EnergyXT**, allowing you to use both 32-bit and 64-bit Windows VST2 plugins diff --git a/meson.build b/meson.build index 7b4e34ed..54a40c3e 100644 --- a/meson.build +++ b/meson.build @@ -15,7 +15,11 @@ project( # Build options # -with_32bit_libraries = get_option('build.cpp_args').contains('-m32') +# In theory yabridge should compile fine on a 32-bit system, but you will always +# need to pass `-Dwith-bitbridge=true`. We just make sure that we won't build +# any 64-bit binaries in that situation. +is_64bit_system = build_machine.cpu_family() not in ['x86', 'arm'] +with_32bit_libraries = (not is_64bit_system) or get_option('build.cpp_args').contains('-m32') with_bitbridge = get_option('with-bitbridge') with_static_boost = get_option('with-static-boost') with_winedbg = get_option('with-winedbg') @@ -161,12 +165,14 @@ include_dir = include_directories('src/include') # to properly do this, please let me know! winegcc = meson.get_compiler('cpp', native : false) -boost_filesystem_64bit_dep = dependency( - 'boost', - version : '>=1.66', - modules : ['filesystem'], - static : with_static_boost, -) +if is_64bit_system + boost_filesystem_64bit_dep = dependency( + 'boost', + version : '>=1.66', + modules : ['filesystem'], + static : with_static_boost, + ) +endif if with_32bit_libraries or with_bitbridge boost_filesystem_32bit_dep = declare_dependency( dependencies : winegcc.find_library( @@ -192,7 +198,9 @@ if with_32bit_libraries or with_bitbridge ) endif -xcb_64bit_dep = dependency('xcb') +if is_64bit_system + xcb_64bit_dep = dependency('xcb') +endif if with_32bit_libraries or with_bitbridge xcb_32bit_dep = winegcc.find_library('xcb') endif @@ -300,21 +308,23 @@ if with_vst3 ) endif -executable( - individual_host_name_64bit, - individual_host_sources, - native : false, - dependencies : host_common_64bit_dep, - link_args : ['-m64'], -) +if is_64bit_system + executable( + individual_host_name_64bit, + individual_host_sources, + native : false, + dependencies : host_common_64bit_dep, + link_args : ['-m64'], + ) -executable( - group_host_name_64bit, - group_host_sources, - native : false, - dependencies : host_common_64bit_dep, - link_args : ['-m64'], -) + executable( + group_host_name_64bit, + group_host_sources, + native : false, + dependencies : host_common_64bit_dep, + link_args : ['-m64'], + ) +endif if with_bitbridge executable( diff --git a/src/common/vst3/meson.build b/src/common/vst3/meson.build index 0a3d5da6..e097a963 100644 --- a/src/common/vst3/meson.build +++ b/src/common/vst3/meson.build @@ -45,32 +45,34 @@ vst3_sdk_native = static_library( override_options : ['warning_level=0'], ) -# And two more dependencies for the host SDK for our Wine host applications -vst3_base_wine_64bit = static_library( - 'vst3_base_wine_64bit', - vst3.get_variable('base_sources'), - native : false, - cpp_args : vst3_compiler_options + wine_64bit_compiler_options + [ '-Wno-cpp'], - include_directories : vst3_include_dir, - override_options : ['warning_level=0'], -) -vst3_pluginterfaces_wine_64bit = static_library( - 'vst3_pluginterfaces_wine_64bit', - vst3.get_variable('pluginterfaces_sources'), - native : false, - cpp_args : vst3_compiler_options + wine_64bit_compiler_options, - include_directories : vst3_include_dir, - override_options : ['warning_level=0'], -) -vst3_sdk_hosting_wine_64bit = static_library( - 'vst3_sdk_hosting_wine_64bit', - vst3.get_variable('sdk_common_sources') + vst3.get_variable('sdk_hosting_sources'), - native : false, - link_with : [vst3_base_wine_64bit, vst3_pluginterfaces_wine_64bit], - cpp_args : vst3_compiler_options + wine_64bit_compiler_options + ['-Wno-multichar'], - include_directories : vst3_include_dir, - override_options : ['warning_level=0'], -) +# We need a separate host SDK dependency for our Wine plugin host applications +if is_64bit_system + vst3_base_wine_64bit = static_library( + 'vst3_base_wine_64bit', + vst3.get_variable('base_sources'), + native : false, + cpp_args : vst3_compiler_options + wine_64bit_compiler_options + [ '-Wno-cpp'], + include_directories : vst3_include_dir, + override_options : ['warning_level=0'], + ) + vst3_pluginterfaces_wine_64bit = static_library( + 'vst3_pluginterfaces_wine_64bit', + vst3.get_variable('pluginterfaces_sources'), + native : false, + cpp_args : vst3_compiler_options + wine_64bit_compiler_options, + include_directories : vst3_include_dir, + override_options : ['warning_level=0'], + ) + vst3_sdk_hosting_wine_64bit = static_library( + 'vst3_sdk_hosting_wine_64bit', + vst3.get_variable('sdk_common_sources') + vst3.get_variable('sdk_hosting_sources'), + native : false, + link_with : [vst3_base_wine_64bit, vst3_pluginterfaces_wine_64bit], + cpp_args : vst3_compiler_options + wine_64bit_compiler_options + ['-Wno-multichar'], + include_directories : vst3_include_dir, + override_options : ['warning_level=0'], + ) +endif # And another time for the 32-bit version if with_bitbridge @@ -111,14 +113,16 @@ vst3_sdk_native_dep = declare_dependency( compile_args : vst3_compiler_options, ) -vst3_sdk_hosting_wine_64bit_dep = declare_dependency( - link_with : vst3_sdk_hosting_wine_64bit, - 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_compiler_options + wine_64bit_compiler_options, -) +if is_64bit_system + vst3_sdk_hosting_wine_64bit_dep = declare_dependency( + link_with : vst3_sdk_hosting_wine_64bit, + 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_compiler_options + wine_64bit_compiler_options, + ) +endif if with_bitbridge vst3_sdk_hosting_wine_32bit_dep = declare_dependency( diff --git a/src/wine-host/meson.build b/src/wine-host/meson.build index e72250b7..0450038f 100644 --- a/src/wine-host/meson.build +++ b/src/wine-host/meson.build @@ -6,23 +6,25 @@ # As with the libraries, we cannot call `executable()` here since we would like # to keep all relevant files in the root of the build directory, and Meson # doesn't have a way to customize that yet. -host_64bit_deps = [ - boost_dep, - boost_filesystem_64bit_dep, - bitsery_dep, - function2_dep, - rt_dep, - tomlplusplus_dep, - wine_ole32_dep, - wine_threads_dep, - xcb_64bit_dep, -] -if with_vst3 - host_64bit_deps += [ - vst3_sdk_hosting_wine_64bit_dep, - wine_shell32_dep, - wine_uuid_dep, +if is_64bit_system + host_64bit_deps = [ + boost_dep, + boost_filesystem_64bit_dep, + bitsery_dep, + function2_dep, + rt_dep, + tomlplusplus_dep, + wine_ole32_dep, + wine_threads_dep, + xcb_64bit_dep, ] + if with_vst3 + host_64bit_deps += [ + vst3_sdk_hosting_wine_64bit_dep, + wine_shell32_dep, + wine_uuid_dep, + ] + endif endif if with_bitbridge @@ -146,21 +148,24 @@ group_host_sources = files( version_header, ] -host_common_64bit = static_library( - 'host_common_64bit', - host_common_sources, - native : false, - include_directories : include_dir, - dependencies : host_64bit_deps, - cpp_args : compiler_options + wine_64bit_compiler_options, - link_args : ['-m64'], -) -host_common_64bit_dep = declare_dependency( - link_with : host_common_64bit, - include_directories : include_dir, - dependencies : host_64bit_deps, - compile_args : compiler_options + wine_64bit_compiler_options, -) +if is_64bit_system + host_common_64bit = static_library( + 'host_common_64bit', + host_common_sources, + native : false, + include_directories : include_dir, + dependencies : host_64bit_deps, + cpp_args : compiler_options + wine_64bit_compiler_options, + link_args : ['-m64'], + ) + host_common_64bit_dep = declare_dependency( + link_with : host_common_64bit, + include_directories : include_dir, + dependencies : host_64bit_deps, + compile_args : compiler_options + wine_64bit_compiler_options, + ) +endif + if with_bitbridge host_common_32bit = static_library( 'host_common_32bit',