Meson: Boost dependency should set -DBOOST_ALL_DYN_LINK

Created on 18 Feb 2018  路  3Comments  路  Source: mesonbuild/meson

http://www.boost.org/doc/libs/1_66_0/libs/config/doc/html/index.html
http://www.boost.org/doc/libs/1_66_0/libs/log/doc/html/log/installation/config.html
http://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/utf_reference/link_references/link_boost_test_dyn_link.html

All libraries either prefer or require defining this flag if dynamic boost library is linked. I believe this should be exported as part of dependencies' compile_args. Probably more granular approach can be used to export only BOOST_{LIB}_DYN_LINK for boost modules that were requested.

boost

Most helpful comment

Please take a look on boost test case. boost::log is one of the best examples because it is library with multiple build modes and linkage modes. In the test we have to define BOOST_LOG_DYN_LINK since we are linking with shared library, we must not define it if we are linking with static version. In my opinion since meson knows that we are linking with shared version of boost_log, BOOST_LOG_DYN_LINK should be exported as compiler_args of dependency automatically, and user does not need to specify that.

2nd question: no, it is not windows specific at all.

All 3 comments

What is this for - what happens if you don't set this? I have never seen this set in practice, so I'm wondering if this is specific to windows and/or autolink.

Please take a look on boost test case. boost::log is one of the best examples because it is library with multiple build modes and linkage modes. In the test we have to define BOOST_LOG_DYN_LINK since we are linking with shared library, we must not define it if we are linking with static version. In my opinion since meson knows that we are linking with shared version of boost_log, BOOST_LOG_DYN_LINK should be exported as compiler_args of dependency automatically, and user does not need to specify that.

2nd question: no, it is not windows specific at all.

https://github.com/sarum9in/meson/pull/7 this is roughly implementation I want. Just a prototype for now, we still need to fix #3082 before we can test it properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amitdo picture amitdo  路  6Comments

denizzzka picture denizzzka  路  4Comments

elig0n picture elig0n  路  5Comments

ignatenkobrain picture ignatenkobrain  路  4Comments

eyelash picture eyelash  路  4Comments