在Ubuntu16.04LTS与gcc-8构建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-build引用这里。但是我得到了一个错误404页面是找不到的。
对于Boost Build的旧参考,如发现的,这里似乎也没有在调试和发布模式下构建boost库的必要细节。
提前谢谢。
发布于 2019-03-18 02:56:52
正如--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=tagged或--layout=versioned选项来允许多个变体。
还有一个--buildid=ID选项,它也列出在--help输出中,它将允许您在结果上放置一个自定义标记。在你想要一个更短的名字或者保持事情尽可能简单的情况下是很有用的。但是要注意,因为它是自定义的使用者,即构建系统,因此不可能知道如何处理名称。
发布于 2021-01-15 05:01:52
debug-symbols=on variant=debug选项集构建调试配置:
<debug-symbols> on, off - Create debug symbols.
<variant> debug, release, profile - Build debug, release or profile version.-a选项也很有用,因为它构建了所有可能的配置组合。
这样,b2 -a install就可以满足boost中所有可能的需求。
https://stackoverflow.com/questions/54306896
复制相似问题