3

Is it possible to build Boost Log as a dynamic library (.dll/.so), but do so within a static Boost build? I'd like all the other Boost libraries to be static, and only Boost Log as a .dll (because several .dlls use it within the same application).

Do all the Boost libraries need to be dynamic to get a Boost Log .dll? I've tried to add define=BOOST_LOG_DYN_LINK to my bjam command line, to no avail:

bjam --toolset=msvc-10.0 address-model=64 variant=release,debug link=static threading=multi runtime-link=static define=BOOST_LOG_DYN_LINK
manlio
  • 18,345
  • 14
  • 76
  • 126
Răzvan Cojocaru
  • 883
  • 9
  • 12

1 Answers1

2

You can narrow the scope of the build by specifying only the library you want to build using the --with-<library> switch, eg.,

./bjam link=shared --with-log ...

mockinterface
  • 14,452
  • 5
  • 28
  • 49
  • `link=shared --with-log link=static threading=multi runtime-link=static`: error: link=shared together with runtime-link=static is not allowed. such property combination is either impossible or too dangerious to be of any use – Răzvan Cojocaru Feb 11 '14 at 13:36
  • @RazvanCojocaru Remove runtime-link-static of course, it conflicts with the link=shared - you indicated that you want to build boost for dynamic linking. – mockinterface Feb 11 '14 at 20:37
  • No, I would like all the Boost libraries to be static (with a static-runtime), except Boost Log, which should be dynamic, but still use a static runtime, and static Boost libraries (because it would be used within a bunch of dynamically loaded DLLs and the executable that loads them). – Răzvan Cojocaru Feb 12 '14 at 08:37
  • Since technically your answer is the best that can be done with bjam, and it appears that my question wasn't precise enough, I'll mark it as an answer for future reference. Thanks. – Răzvan Cojocaru Feb 12 '14 at 08:44