Boost库在Linux上调试和发布版本

Boost库在Linux上调试和发布版本,boost,boost-build,Boost,Boost Build,我在使用gcc-8在Ubuntu 16.04 LTS上构建Boost库时遇到问题 目前,我需要构建调试和发布构建库 以下是我用来为调试构建构建库的命令: $ ./bootstrap.sh --with-libraries=all --with-python-version=3.5 --with-icu="/usr/include/x86_64-linux-gnu/" ################### # For Debug build # ################### $ ./b

我在使用gcc-8在Ubuntu 16.04 LTS上构建Boost库时遇到问题

目前,我需要构建调试和发布构建库

以下是我用来为调试构建构建库的命令:

$ ./bootstrap.sh --with-libraries=all --with-python-version=3.5 --with-icu="/usr/include/x86_64-linux-gnu/"
###################
# For Debug build #
###################
$ ./b2 toolset=gcc-8 cxxflags="-std=c++17" variant=debug
#####################
# For Release build #
#####################
$ ./b2 toolset=gcc-8 cxxflags="-std=c++17" variant=release
问题是,即使变量指定为
debug
release
,构建也会使用相同的名称构建库

每个生成步骤都会覆盖由上一个命令生成的库

如何根据上述文档获取可能后缀为
-d
的调试库

我还尝试研究了前面提到的
boost构建
参考。 但是我得到一个错误404页面未找到

boostbuildas-as-find的旧参考似乎也没有在调试和发布模式下构建Boost库的必要细节


提前感谢。

--help
信息中所述,在Unix类型的系统上,
--layout
的默认设置是
system
,它不添加允许多个构建变体共存的标记:

--layout=<layout>       Determine whether to choose library names and header
                        locations such that multiple versions of Boost or
                        multiple compilers can be used on the same system.

                          -- versioned -- Names of boost binaries include
                          the Boost version number, name and version of
                          the compiler and encoded build properties. Boost
                          headers are installed in a subdirectory of
                          <HDRDIR> whose name contains the Boost version
                          number.

                          -- tagged -- Names of boost binaries include the
                          encoded build properties such as variant and
                          threading, but do not including compiler name
                          and version, or Boost version. This option is
                          useful if you build several variants of Boost,
                          using the same compiler.

                          -- system -- Binaries names do not include the
                          Boost version number or the name and version
                          number of the compiler. Boost headers are
                          installed directly into <HDRDIR>. This option is
                          intended for system integrators building
                          distribution packages.

                        The default value is 'versioned' on Windows, and
                        'system' on Unix.
--layout=确定是否选择库名称和标题
多个版本的Boost或
同一系统上可以使用多个编译器。
--版本控制--boost二进制文件的名称包括
的Boost版本号、名称和版本
编译器和编码的生成属性。促进
标头安装在的子目录中
其名称包含Boost版本
号码。
--taged——boost二进制文件的名称包括
编码的生成属性,如变量和
线程,但不包括编译器名称
和版本,或增强版本。这个选项是
如果您构建多个Boost变体,则非常有用,
使用相同的编译器。
--系统--二进制文件名称不包括
Boost版本号或名称和版本
编译器的编号。增压头是
直接安装到。这个选项是
适用于系统集成商大楼
分发包。
Windows上的默认值为“版本控制”,并且
Unix上的“系统”。
您可以使用
--layout=taged
--layout=versioned
选项在生成时允许多个变体

还有一个
--buildid=ID
选项,也在
--help
输出中列出,它允许您在结果上添加自定义标记。在您希望使用较短的名称或使事情尽可能简单的情况下非常有用。但是要注意,因为它是定制的消费者,即构建系统,所以可能不知道如何处理名称。

debug symbols=on variant=debug
选项集生成调试配置:

<debug-symbols> on, off - Create debug symbols.

<variant>   debug, release, profile - Build debug, release or profile version.

on,off-创建调试符号。
调试、发布、概要文件-生成调试、发布或概要文件版本。
-一个
选项也很有用,因为它构建了所有可能的配置组合


通过这种方式
b2-安装
可以满足boost中所有可能的需求。

我正在寻找类似于cmake的选项:
cmake\u DEBUG\u POSTFIX
,我之前尝试过这个解决方案,但它涉及到更改所有依赖于boost库的存储库中的库名依赖项,而不仅仅是指定库的基本名称。当一个人想要获得跨平台的支持时,这很快就会变得困难。