Use Meson to configure Boost subprojects instead of CMake

Boost's CMake files try to access the Internet for absolutely no reason.
This commit is contained in:
刘皓 2025-05-14 16:55:35 -04:00
parent d5f4d6777a
commit 042d6f3e9d
No known key found for this signature in database
GPG key ID: 7901753DB465B711
23 changed files with 95 additions and 19 deletions

View file

@ -29,26 +29,12 @@ if is_libretro
}
global_dependencies += subproject('libiconv', default_options: libiconv_options).get_variable('libiconv')
boost_options = cmake.subproject_options()
boost_options.add_cmake_defines({
'CMAKE_POLICY_VERSION_MINIMUM': '3.10',
'CMAKE_C_FLAGS': ' '.join(global_args),
'CMAKE_CXX_FLAGS': ' '.join(global_args + global_cpp_args),
'CMAKE_POSITION_INDEPENDENT_CODE': use_pic,
'BUILD_TESTING': false,
})
global_dependencies += [
cmake.subproject('boost_asio', options: boost_options).dependency('boost_asio'),
cmake.subproject('boost_mp11', options: boost_options).dependency('boost_mp11'),
cmake.subproject('boost_describe', options: boost_options).dependency('boost_describe'),
cmake.subproject('boost_config', options: boost_options).dependency('boost_config'),
cmake.subproject('boost_assert', options: boost_options).dependency('boost_assert'),
cmake.subproject('boost_static_assert', options: boost_options).dependency('boost_static_assert'),
cmake.subproject('boost_throw_exception', options: boost_options).dependency('boost_throw_exception'),
cmake.subproject('boost_core', options: boost_options).dependency('boost_core'),
cmake.subproject('boost_container_hash', options: boost_options).dependency('boost_container_hash'),
cmake.subproject('boost_type_traits', options: boost_options).dependency('boost_type_traits'),
cmake.subproject('boost_optional', options: boost_options).dependency('boost_optional'),
subproject('boost_asio').get_variable('boost_asio'),
subproject('boost_core').get_variable('boost_core'),
subproject('boost_container_hash').get_variable('boost_container_hash'),
subproject('boost_optional').get_variable('boost_optional'),
subproject('boost_type_traits').get_variable('boost_type_traits'),
]
zlib_options = cmake.subproject_options()

View file

@ -2,4 +2,5 @@
url = https://github.com/boostorg/asio
revision = boost-1.87.0
depth = 1
patch_directory = boost_asio
diff_files = boost_asio-counter.patch

View file

@ -2,4 +2,5 @@
url = https://github.com/boostorg/assert
revision = boost-1.87.0
depth = 1
patch_directory = boost_assert
diff_files = boost_assert-snprintf.patch

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/config
revision = boost-1.87.0
depth = 1
patch_directory = boost_config

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/container_hash
revision = boost-1.87.0
depth = 1
patch_directory = boost_container_hash

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/core
revision = boost-1.87.0
depth = 1
patch_directory = boost_core

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/describe
revision = boost-1.87.0
depth = 1
patch_directory = boost_describe

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/mp11
revision = boost-1.87.0
depth = 1
patch_directory = boost_mp11

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/optional
revision = boost-1.87.0
depth = 1
patch_directory = boost_optional

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/static_assert
revision = boost-1.87.0
depth = 1
patch_directory = boost_static_assert

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/throw_exception
revision = boost-1.87.0
depth = 1
patch_directory = boost_throw_exception

View file

@ -2,3 +2,4 @@
url = https://github.com/boostorg/type_traits
revision = boost-1.87.0
depth = 1
patch_directory = boost_type_traits

View file

@ -0,0 +1,4 @@
project('boost_asio', 'cpp', meson_version: '>=1.3.0')
boost_asio = declare_dependency(
include_directories: 'include',
)

View file

@ -0,0 +1,7 @@
project('boost_assert', 'cpp', meson_version: '>=1.3.0')
boost_assert = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_config').get_variable('boost_config'),
],
)

View file

@ -0,0 +1,4 @@
project('boost_config', 'cpp', meson_version: '>=1.3.0')
boost_config = declare_dependency(
include_directories: 'include',
)

View file

@ -0,0 +1,9 @@
project('boost_container_hash', 'cpp', meson_version: '>=1.3.0')
boost_container_hash = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_config').get_variable('boost_config'),
subproject('boost_describe').get_variable('boost_describe'),
subproject('boost_mp11').get_variable('boost_mp11'),
],
)

View file

@ -0,0 +1,10 @@
project('boost_core', 'cpp', meson_version: '>=1.3.0')
boost_core = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_assert').get_variable('boost_assert'),
subproject('boost_config').get_variable('boost_config'),
subproject('boost_static_assert').get_variable('boost_static_assert'),
subproject('boost_throw_exception').get_variable('boost_throw_exception'),
],
)

View file

@ -0,0 +1,7 @@
project('boost_describe', 'cpp', meson_version: '>=1.3.0')
boost_describe = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_mp11').get_variable('boost_mp11'),
],
)

View file

@ -0,0 +1,4 @@
project('boost_mp11', 'cpp', meson_version: '>=1.3.0')
boost_mp11 = declare_dependency(
include_directories: 'include',
)

View file

@ -0,0 +1,11 @@
project('boost_optional', 'cpp', meson_version: '>=1.3.0')
boost_optional = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_assert').get_variable('boost_assert'),
subproject('boost_config').get_variable('boost_config'),
subproject('boost_core').get_variable('boost_core'),
subproject('boost_throw_exception').get_variable('boost_throw_exception'),
subproject('boost_type_traits').get_variable('boost_type_traits'),
],
)

View file

@ -0,0 +1,7 @@
project('boost_static_assert', 'cpp', meson_version: '>=1.3.0')
boost_static_assert = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_config').get_variable('boost_config'),
],
)

View file

@ -0,0 +1,8 @@
project('boost_throw_exception', 'cpp', meson_version: '>=1.3.0')
boost_throw_exception = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_assert').get_variable('boost_assert'),
subproject('boost_config').get_variable('boost_config'),
],
)

View file

@ -0,0 +1,8 @@
project('boost_type_traits', 'cpp', meson_version: '>=1.3.0')
boost_type_traits = declare_dependency(
include_directories: 'include',
dependencies: [
subproject('boost_config').get_variable('boost_config'),
subproject('boost_static_assert').get_variable('boost_static_assert'),
],
)