Boost: How bjam constructs a library name?

拥有回忆 提交于 2020-06-09 16:31:20

问题


I was looking in the jam files, how the name of library is constructed. Example: libboost_log-mgw46-mt-1_48.dll

I would like to ignore the last part, how to pass linker the -o parameter with my constructed name. I have few versions and linking in a big project forces me to do changes in project file and that is a lot of places.

My wish is to get libboost_log.dll. I did just rename, but when executing a program it says, that it can not find libboost_log-mgw46-mt-1_48.dll file.


回答1:


Boost Bjam has 3 different layouts of naming defined. To quote the help placed in Jamroot file (I'm not aware of any better online documentation):

#   --layout=<layout>       Determines 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 who are
#                               building distribution packages.
#
#                           The default value is 'versioned' on Windows, and
#                           'system' on Unix.

The system layout gives the naming scheme you want - plain basename without any other information.

Names for Boost output files according to these layouts are generated using the tag rule, defined in boostcpp.jam file.



来源:https://stackoverflow.com/questions/8940249/boost-how-bjam-constructs-a-library-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!