From c4842ccda6160a0e98bde653e869ea0d5dd3268e Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 8 Jun 2020 15:59:28 +0200 Subject: [PATCH] Make use-* aliases for new with-* build options The 'use-*' variants will be marked as deprecated in a future version. --- .github/workflows/build.yml | 4 ++-- CHANGELOG.md | 3 +++ README.md | 6 +++--- meson.build | 25 ++++++++++++++++--------- meson_options.txt | 14 ++++++++++++++ src/plugin/host-process.cpp | 10 +++++----- src/plugin/plugin-bridge.cpp | 8 ++++---- 7 files changed, 47 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b21355ea..6858803a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: # Statically link to libstdc++ on Ubuntu 18.04 as we're compiling # with a newer version of g++ than what's in the default repos - meson setup --buildtype=release --cross-file cross-wine.conf -Dwith-static-boost=true -Duse-bitbridge=true -Dcpp_link_args='-static-libstdc++' -Dbuild.cpp_link_args='-static-libstdc++' build + meson setup --buildtype=release --cross-file cross-wine.conf -Dwith-static-boost=true -Dwidth-bitbridge=true -Dcpp_link_args='-static-libstdc++' -Dbuild.cpp_link_args='-static-libstdc++' build ninja -C build - name: Create an archive for the binaries run: | @@ -91,7 +91,7 @@ jobs: mkdir -p /tmp/prefix export WINEPREFIX=/tmp/prefix - meson setup --buildtype=release --cross-file cross-wine.conf -Dwith-static-boost=true -Duse-bitbridge=true build + meson setup --buildtype=release --cross-file cross-wine.conf -Dwith-static-boost=true -Dwidth-bitbridge=true build ninja -C build - name: Create an archive for the binaries run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d4e06c5..144f3268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - When building from source, only statically link Boost when the `with-static-boost` option is enabled. +- The `use-bitbridge` and `use-winedbg` options have been replaced by + `with-bitbridge` and `with-winedbg` for consistency's sake. The old options + will be marked as deprecated in the next minor release. ### Fixed diff --git a/README.md b/README.md index e9f835b2..be77ddd6 100644 --- a/README.md +++ b/README.md @@ -336,9 +336,9 @@ bit versions of the Boost and XCB libraries. This can then be set up as follows: ```shell # Enable the bitbridge on an existing build -meson configure build -Duse-bitbridge=true +meson configure build -Dwidth-bitbridge=true # Or configure a new build from scratch -meson setup --buildtype=release --cross-file cross-wine.conf -Duse-bitbridge=true build +meson setup --buildtype=release --cross-file cross-wine.conf -Dwidth-bitbridge=true build ninja -C build ``` @@ -401,5 +401,5 @@ Other desktop environments and window managers will require some slight modifications in `src/plugin/plugin-bridge.cpp`. To enable this, simply run: ```shell -meson configure build --buildtype=debug -Duse-winedbg=true +meson configure build --buildtype=debug -Dwidth-winedbg=true ``` diff --git a/meson.build b/meson.build index 3c16f167..0c72897b 100644 --- a/meson.build +++ b/meson.build @@ -31,13 +31,20 @@ group_host_name_32bit = 'yabridge-group-32' # https://github.com/boostorg/asio/issues/312 compiler_options = ['-DBOOST_ASIO_DISABLE_CONCEPTS'] +# TODO: Mark the `use-` versions of these options as deprecated in the next +# minor version +with_bitbridge = get_option('use-bitbridge') or get_option('with-bitbridge') +with_static_boost = get_option('with-static-boost') +with_winedbg = get_option('use-winedbg') or get_option('with-winedbg') + +if with_bitbridge + compiler_options += '-DWITH_BITBRIDGE' +endif + # This provides an easy way to start the Wine VST host using winedbg since it # can be quite a pain to set up -if get_option('use-winedbg') - compiler_options += '-DUSE_WINEDBG' -endif -if get_option('use-bitbridge') - compiler_options += '-DUSE_BITBRIDGE' +if with_winedbg + compiler_options += '-DWITH_WINEDBG' endif # Generate header files for configuration variables such as the current git tag @@ -46,12 +53,12 @@ subdir('src/common/config') # Statically link against Boost.Filesystem, otherwise it would become impossible # to distribute a prebuilt version of yabridge -boost_dep = dependency('boost', version : '>=1.66', static : get_option('with-static-boost')) +boost_dep = dependency('boost', version : '>=1.66', static : with_static_boost) boost_filesystem_dep = dependency( 'boost', version : '>=1.66', modules : ['filesystem'], - static : get_option('with-static-boost') + static : with_static_boost ) bitsery_dep = subproject('bitsery').get_variable('bitsery_dep') threads_dep = dependency('threads') @@ -142,7 +149,7 @@ executable( link_args : ['-m64'] ) -if get_option('use-bitbridge') +if with_bitbridge message('Bitbridge enabled, configuring a 32-bit host application') # I honestly have no idea what the correct way is to have `dependency()` or @@ -153,7 +160,7 @@ if get_option('use-bitbridge') winegcc = meson.get_compiler('cpp', native : false) boost_filesystem_dep = winegcc.find_library( 'boost_filesystem', - static : get_option('with-static-boost'), + static : with_static_boost, dirs : [ # Used by Arch based distros '/usr/local/lib32', diff --git a/meson_options.txt b/meson_options.txt index 6737ca1a..3379f417 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,6 +5,13 @@ option( 'use-bitbridge', type : 'boolean', value : false, + description : 'Alias for `with-bitbridge`, will be marked as deprecated in the next minor version.' +) + +option( + 'with-bitbridge', + type : 'boolean', + value : false, description : 'Build a 32-bit host application for hosting 32-bit plugins. See the readme for full instructions on how to use this.' ) @@ -19,5 +26,12 @@ option( 'use-winedbg', type : 'boolean', value : false, + description : 'Alias for `with-winedbg`, will be marked as deprecated in the next minor version.' +) + +option( + 'with-winedbg', + type : 'boolean', + value : false, description : 'Whether to run the Wine VST host with GDB attached. Might not always be reliable.' ) diff --git a/src/plugin/host-process.cpp b/src/plugin/host-process.cpp index d4184d4d..94988f4f 100644 --- a/src/plugin/host-process.cpp +++ b/src/plugin/host-process.cpp @@ -36,7 +36,7 @@ namespace fs = boost::filesystem; template bp::child launch_host(fs::path host_path, Args&&... args) { return bp::child( -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG // This is set up for KDE Plasma. Other desktop environments and // window managers require some slight modifications to spawn a // detached terminal emulator. @@ -85,7 +85,7 @@ IndividualHost::IndividualHost(boost::asio::io_context& io_context, plugin_arch(find_vst_architecture(plugin_path)), host_path(find_vst_host(plugin_arch, false)), host(launch_host(host_path, -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG plugin_path.filename(), #else plugin_path, @@ -94,13 +94,13 @@ IndividualHost::IndividualHost(boost::asio::io_context& io_context, bp::env = set_wineprefix(), bp::std_out = stdout_pipe, bp::std_err = stderr_pipe -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG , // winedbg has no reliable way to escape spaces, so // we'll start the process in the plugin's directory bp::start_dir = plugin_path.parent_path() #endif )) { -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG if (plugin_path.string().find(' ') != std::string::npos) { logger.log("Warning: winedbg does not support paths containing spaces"); } @@ -135,7 +135,7 @@ GroupHost::GroupHost( plugin_arch(find_vst_architecture(plugin_path)), host_path(find_vst_host(plugin_arch, true)), host_vst_dispatch(host_vst_dispatch) { -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG if (plugin_path.string().find(' ') != std::string::npos) { logger.log("Warning: winedbg does not support paths containing spaces"); } diff --git a/src/plugin/plugin-bridge.cpp b/src/plugin/plugin-bridge.cpp index befd3da3..4b9350c3 100644 --- a/src/plugin/plugin-bridge.cpp +++ b/src/plugin/plugin-bridge.cpp @@ -78,7 +78,7 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback) wine_io_handler([&]() { io_context.run(); }) { log_init_message(); -#ifndef USE_WINEDBG +#ifndef WITH_WINEDBG // If the Wine process fails to start, then nothing will connect to the // sockets and we'll be hanging here indefinitely. To prevent this, we'll // periodically poll whether the Wine process is still running, and throw @@ -622,13 +622,13 @@ void PluginBridge::log_init_message() { // Include a list of enabled compile-tiem features, mostly to make debug // logs more useful init_msg << "Enabled features:" << std::endl; -#ifdef USE_BITBRIDGE +#ifdef WITH_BITBRIDGE init_msg << "- bitbridge support" << std::endl; #endif -#ifdef USE_WINEDBG +#ifdef WITH_WINEDBG init_msg << "- winedbg" << std::endl; #endif -#if !(defined(USE_BITBRIDGE) || defined(USE_WINEDBG)) +#if !(defined(WITH_BITBRIDGE) || defined(WITH_WINEDBG)) init_msg << " " << std::endl; #endif init_msg << std::endl;