7 Nov
2018
7 Nov
'18
4:09 p.m.
I'm looking for an example for how I could check to see if "-fPIC" is supported for the compiler as part of project requirements. In some recent PRs that include building a static library which then gets included in a shared library, code needs to be built with "-fPIC" on supported platforms/toolsets. There is some code in gcc.jam to do this if the overall link mode is shared (note: this code is not in clang.jam!), but in this case the overall link mode is static, and a Jamfile wraps the result in a shared library, so the directives in gcc.jam are not applied. So at the top level Jamfile, I want to add a project requirement that basically says, "if the compiler supports <cxxflags>-fPIC then use it". Thanks, Jim