Don't statically link Boost by default #20

Since this would only be needed for distribution, and we're already
doing something similar for libstdc++ on the Ubuntu 18.04 build. This
moves the static linking behind a new build option.
This commit is contained in:
Robbert van der Helm
2020-06-08 15:46:09 +02:00
parent 9ecb65664c
commit 9385360331
4 changed files with 25 additions and 5 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ jobs:
# Statically link to libstdc++ on Ubuntu 18.04 as we're compiling # 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 # 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 ninja -C build
- name: Create an archive for the binaries - name: Create an archive for the binaries
run: | run: |
@@ -91,7 +91,7 @@ jobs:
mkdir -p /tmp/prefix mkdir -p /tmp/prefix
export WINEPREFIX=/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 ninja -C build
- name: Create an archive for the binaries - name: Create an archive for the binaries
run: | run: |
+5
View File
@@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### Changed
- When building from source, only statically link Boost when the
`with-static-boost` option is enabled.
### Fixed ### Fixed
- Fixed plugin group socket name generation. This prevented plugin groups with - Fixed plugin group socket name generation. This prevented plugin groups with
+8 -3
View File
@@ -46,8 +46,13 @@ subdir('src/common/config')
# Statically link against Boost.Filesystem, otherwise it would become impossible # Statically link against Boost.Filesystem, otherwise it would become impossible
# to distribute a prebuilt version of yabridge # to distribute a prebuilt version of yabridge
boost_dep = dependency('boost', version : '>=1.66', 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 : true) boost_filesystem_dep = dependency(
'boost',
version : '>=1.66',
modules : ['filesystem'],
static : get_option('with-static-boost')
)
bitsery_dep = subproject('bitsery').get_variable('bitsery_dep') bitsery_dep = subproject('bitsery').get_variable('bitsery_dep')
threads_dep = dependency('threads') threads_dep = dependency('threads')
tomlplusplus_dep = subproject('tomlplusplus').get_variable('tomlplusplus_dep') tomlplusplus_dep = subproject('tomlplusplus').get_variable('tomlplusplus_dep')
@@ -148,7 +153,7 @@ if get_option('use-bitbridge')
winegcc = meson.get_compiler('cpp', native : false) winegcc = meson.get_compiler('cpp', native : false)
boost_filesystem_dep = winegcc.find_library( boost_filesystem_dep = winegcc.find_library(
'boost_filesystem', 'boost_filesystem',
static : true, static : get_option('with-static-boost'),
dirs : [ dirs : [
# Used by Arch based distros # Used by Arch based distros
'/usr/local/lib32', '/usr/local/lib32',
+10
View File
@@ -1,3 +1,6 @@
# TODO: For the next major or minor release, deprecate these `use-*` flags and
# replace them with `with-*` variants.
option( option(
'use-bitbridge', 'use-bitbridge',
type : 'boolean', 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.' 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( option(
'use-winedbg', 'use-winedbg',
type : 'boolean', type : 'boolean',