What does it exactly mean, when I pass <link>static feature to requirements section when building an executable?
exe main
: main.cpp
/libs//my_library
: <library>/boost//thread
<link>static
;
Does this mean that both /libs//my_library and <library>/boost//thread has to be built with static linkage?
If my target /libs//my_library has <link>static requirement set (is built only with this feature), will there be raised an error if I ommit the <link>static requirement for all targets that depends on this library (just like the one above)?
It means to build (and link to) the dependency libraries statically.
Yes.
No, that is OK. If your library has
<link>staticas a requirement, then it will be built statically no matter what, and it isn’t necessary to have<link>staticin a dependent target just for the sake of this library alone.Note that it is possible to request a specific dependency library to be built statically without affecting other dependency libraries, like this:
exe e : /libs//mylib/<link>static /libs//otherlib /libs//someotherlibThis
<link>staticabove doesn’t affectotherlibandsomeotherlib, it pertains only tomylib.