VCPKG:如何在 ICU 支持下构建**所有 Boost**

VCPKG: How do you build **all of Boost** with ICU support

以下命令使用 VCPKG 构建 boost。

vcpkg install boost:x64-windows boost:x64-windows

此命令构建 所有 Boost。具体来说,它构建了以下包:boost-accumulators、boost-algorithm、boost-align、boost-any、boost-array、boost-asio、boost-assert、boost-assign、boost-atomic、boost-beast、boost-bimap , boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost -context (!uwp)、boost-contract (!arm)、boost-conversion、boost-convert、boost-core、boost-coroutine (!uwp)、boost-coroutine2、boost-crc、boost-date-time、boost -细节、boost-disjoint-sets、boost-dll、boost-dynamic-bitset、boost-endian、boost-exception、boost-fiber (windows)、boost-filesystem (!uwp)、boost-flyweight、 boost-foreach、boost-format、boost-function、boost-functional、boost-function-types、boost-fusion、boost-geometry、boost-gil、boost-graph、boost-graph-parallel、boost-hana、boost-堆,boost-直方图,boost-hof,boost-icl,boost-integer,boost-interprocess,boost-intrusive,boost-io,boost-io流(!uwp),boost-iterator,boost-lambda,boost-lexical-cast,boost-locale(!uwp),boost-local-function,boost-lockfree,boost-log(!uwp),boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-numeric-conversion, boost-interval, boost-odeint、boost-ublas、boost-safe-numerics、boost-optional、boost-outcome、boost-parameter、boost-parameter-python (windows)、boost-phoenix、boost-polygon , boost-poly-collection, boost-pool, boost-predef, boost-预处理器, boost-process, boost-program-options, boost-属性-map, boost-属性-tree, boost -proto、boost-ptr-container、boost-python (windows)、boost-qvm、boost-random、boost-range、boost-ratio、boost-rational、boost-regex、boost-数字转换,升压间隔,升压odeint,升压ublas,升压安全数字,升压范围退出,升压序列化,升压信号2,升压智能ptr,升压排序,升压精神,升压堆栈跟踪(!uwp),升压状态rt, boost-static-assert, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), boost-type-in​​dex, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp)、boost-winapi、boost-xpressive 和 boost-yap。

问题是此命令不构建具有 ICU 支持的 Boost。

"vcpkg search" 命令包含以下相关条目。

boost                1.71.0           Peer-reviewed portable C++ source libraries
boost-locale         1.71.0           Boost locale module
boost-locale[icu]                     ICU backend for Boost.Locale
boost-regex          1.71.0           Boost regex module
boost-regex[icu]                      ICU backend for Boost.Regex

以下操作无效,因为它会产生错误。

vcpkg install boost[icu]:x64-windows boost[icu]:x64-windows

以下构建具有 ICU 支持,但它不构建 所有 Boost

vcpkg install boost-locale[icu]:x64-windows boost-locale[icu]:x64-windows boost-regex[icu]:x64-windows boost-regex[icu]:x64-windows

构建 boost-locale 构建以下组件:boost-locale、boost-assert、boost-build、boost-config、boost-function、boost-integer、boost-iterator、boost-modular-build-helper、 boost-smart-ptr、boost-static-assert、boost-system、boost-thread、boost-type-traits、boost-unordered 和 boost-vcpkg-helpers。

构建 boost-regex 构建以下组件:boost-regex、boost-assert、boost-build、boost-compatibility、boost-concept-check、boost-config、boost-container-hash、boost-core、 boost-detail, boost-integer, boost-iterator, boost-modular-build-helper, boost-mpl, boost-predef, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-类型-特征、提升实用程序和提升 vcpkg 助手。

boost-locale 和 boost-regex 都省略了 boost-accumulators 等组件。

先安装 boost,然后安装 boost-locale 和 boost-regex 会导致出现某种“您想重建”消息。

应该只有一个命令来构建 所有具有 ICU 支持的 Boost,而无需重建废话。

事实证明,对于那些支持ICU特性的组件,可以在使用ICU的同时构建所有的Boost,如下所示。

./vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet x64-windows --recurse

来源:How do I build boost with ICU support without having to build most components of boost twice?