Boost: Как bjam создает имя библиотеки? - PullRequest
23 голосов
/ 20 января 2012

Я искал в файлах джема, как строится название библиотеки. Пример: libboost_log-mgw46-mt-1_48.dll

Я бы хотел проигнорировать последнюю часть, как передать компоновщику параметр -o с моим созданным именем. У меня есть несколько версий, и ссылки в большом проекте вынуждают меня вносить изменения в файл проекта, и это много мест.

Мое желание - получить libboost_log.dll. Я просто переименовал, но при выполнении программы он говорит, что не может найти libboost_log-mgw46-mt-1_48.dll файл.

1 Ответ

30 голосов
/ 04 марта 2012

Boost Bjam имеет Определены 3 различные схемы именования . Чтобы процитировать помощь, помещенную в файл Jamroot (я не знаю какой-либо лучшей онлайн-документации):

#   --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.

Макет system дает желаемую схему именования - простое базовое имя без какой-либо другой информации.

Имена выходных файлов Boost согласно этим макетам генерируются с использованием правила tag, определенного в файле boostcpp.jam.

...