Boost库在Linux上的调试和发布构建 [英] Boost Libraries Debug and Release Build on Linux

查看:52
本文介绍了Boost库在Linux上的调试和发布构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am having issues while building the Boost Library on Ubuntu 16.04 LTS with gcc-8.

当前,我需要同时构建Debug和Release构建的库.

Currently I need to build both the Debug and Release built libraries.

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

Here are the commands I have used to build the library for debug build:

$ ./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 ,该构建也会使用相同的名称构建库.

The issue is that even with variant specified as debug or release, the build builds the libraries with the same names.

每个构建步骤都会覆盖上一条命令构建的库.

Each build step overwrites the libraries built by the previous command.

如何根据我还尝试研究

I also tried to look into the boost-build reference mentioned here. But I am getting a Error 404 page is not found.

此处似乎也没有在调试和发布模式下构建boost库的必要细节.

The old reference for Boost Build as found here also does not seems to have the necessary details of building the boost libraries in both debug and release modes.

提前谢谢.

推荐答案

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

As mentioned in the --help information, on Unix type systems the default for --layout is system which doesn't add the tagging that allows for multiple build variations to coexist:

--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 选项在构建时允许多个变体.

You can use either the --layout=tagged or --layout=versioned options to allow the multiple variants when you build.

-help 输出中也列出了-buildid = ID 选项,该选项可让您在结果上放置自定义标记.在您希望使用更短名称或使内容尽可能简单的情况下很有用.但是请注意,由于它是自定义使用者,即构建系统,因此不太可能知道如何处理名称.

There is also a --buildid=ID option, also listed in the --help output, that will let you put a custom tag on the results. Useful in the cases where you want a shorter name or to keep things as simple as possible. But beware that since it's custom consumers, i.e. build systems, will not likely know how to deal with the names.

这篇关于Boost库在Linux上的调试和发布构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆