Boost logo

Boost :

Subject: [boost] Boost.Build check to see if cxxflags flag is supported?
From: James E. King III (jking_at_[hidden])
Date: 2018-11-07 16:09:10


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk