diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 509ab07c..b21355ea 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 -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 -Duse-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 -Duse-bitbridge=true build + meson setup --buildtype=release --cross-file cross-wine.conf -Dwith-static-boost=true -Duse-bitbridge=true build ninja -C build - name: Create an archive for the binaries run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b4e83d6..4d4e06c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- When building from source, only statically link Boost when the + `with-static-boost` option is enabled. + ### Fixed - Fixed plugin group socket name generation. This prevented plugin groups with diff --git a/meson.build b/meson.build index 67a2715d..3c16f167 100644 --- a/meson.build +++ b/meson.build @@ -46,8 +46,13 @@ 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 : true) -boost_filesystem_dep = dependency('boost', version : '>=1.66', modules : ['filesystem'], static : true) +boost_dep = dependency('boost', version : '>=1.66', static : get_option('with-static-boost')) +boost_filesystem_dep = dependency( + 'boost', + version : '>=1.66', + modules : ['filesystem'], + static : get_option('with-static-boost') +) bitsery_dep = subproject('bitsery').get_variable('bitsery_dep') threads_dep = dependency('threads') tomlplusplus_dep = subproject('tomlplusplus').get_variable('tomlplusplus_dep') @@ -148,7 +153,7 @@ if get_option('use-bitbridge') winegcc = meson.get_compiler('cpp', native : false) boost_filesystem_dep = winegcc.find_library( 'boost_filesystem', - static : true, + static : get_option('with-static-boost'), dirs : [ # Used by Arch based distros '/usr/local/lib32', diff --git a/meson_options.txt b/meson_options.txt index 3ec087c3..6737ca1a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,6 @@ +# TODO: For the next major or minor release, deprecate these `use-*` flags and +# replace them with `with-*` variants. + option( 'use-bitbridge', type : 'boolean', @@ -5,6 +8,13 @@ option( description : 'Build a 32-bit host application for hosting 32-bit plugins. See the readme for full instructions on how to use this.' ) +option( + 'with-static-boost', + type : 'boolean', + value : false, + description : 'Enable static linking for Boost. Needed when distributing the binaries to other systems.' +) + option( 'use-winedbg', type : 'boolean',