首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >基于Linux的Boost库调试和发布构建

基于Linux的Boost库调试和发布构建
EN

Stack Overflow用户
提问于 2019-01-22 11:05:24
回答 2查看 2.1K关注 0票数 2

在Ubuntu16.04LTS与gcc-8构建Boost库时,我遇到了一些问题.

目前,我需要同时构建调试和发布构建的库。

下面是用于构建用于调试生成的库的命令:

代码语言:javascript
复制
$ ./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

问题是,即使使用指定为debugrelease的变体,构建的库的名称也是相同的。

每个构建步骤都覆盖由前面的命令构建的库。

如何根据提到的-d文档获得带有可能后缀这里的调试库?

我还试图查看提到的boost-build引用这里。但是我得到了一个错误404页面是找不到的。

对于Boost Build的旧参考,如发现的,这里似乎也没有在调试和发布模式下构建boost库的必要细节。

提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2019-03-18 02:56:52

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

代码语言:javascript
复制
--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=tagged--layout=versioned选项来允许多个变体。

还有一个--buildid=ID选项,它也列出在--help输出中,它将允许您在结果上放置一个自定义标记。在你想要一个更短的名字或者保持事情尽可能简单的情况下是很有用的。但是要注意,因为它是自定义的使用者,即构建系统,因此不可能知道如何处理名称。

票数 2
EN

Stack Overflow用户

发布于 2021-01-15 05:01:52

0/tools/build/tutorial.html

debug-symbols=on variant=debug选项集构建调试配置:

代码语言:javascript
复制
<debug-symbols> on, off - Create debug symbols.

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

-a选项也很有用,因为它构建了所有可能的配置组合。

这样,b2 -a install就可以满足boost中所有可能的需求。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54306896

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档