On 6/19/2017 2:28 PM, Daniel James via Boost wrote:
On 19 June 2017 at 01:53, Gary Furnish via Boost
wrote: For whatever its worth as a user who sometimes contributes patches to fix bugs, I don't use the system compiler and instead use scripts to test different builds of internal code (clang, clang with various sanitizers and options, different versions of gcc, etc). This is such a pain with boost build because of the difficulty of automating building multiple copies with custom compilers and flags with the same source tree. In cmake this is easy, you just change some command line flags, something trivial in scripts. In Boost, I think I got it working once using undocumented features after spending several hours looking around at docs, source code(!), and stack overflow. I now automatically just don't use boost libraries that aren't header only. I would rather rewrite code than fight with the build process. That is a bad state of affairs.
That's odd, that's one thing I've always found easier with boost build than any other build system. You add a target to your user-config.jam, such as:
using gcc : sanitize : g++ -fsanitize=address ;
Then run the build using something like 'b2 gcc-sanitize'.
I have been doing something similar. But according to the Boost Build docs ( http://www.boost.org/build/doc/html/bbv2/reference/tools.html#bbv2.reference... ) the "sanitize" in your example is the gcc version. So I might have the equivalent of: using gcc : 6.3sanitize : g++ : -fsanitize=address ; and I no doubt delude myself in thinking that when I might run 'b2 gcc-6.3sanitize' that Boost Build actually checks that the version I am using is gcc 6.3. In the docs it does not really say what Boost Build actyally does with that 'version' in the using gcc rule.
I think there's some way of specifying flags at the command line
'b2 gcc-sanitize cxxflags=-fsanitize=address' should also work.
, but I find it's easier just to set up a number of configurations in the configuration file. So when developing unordered, if I want to run the insert tests, I might do something like this:
cd libs/unordered/test b2 -q insert_tests gcc gcc-std11 clang clang-std14
I agree with you but I am pretty sure the problem is end-users trying to understand that you can do these things with Boost Build. It is not so much that the information is not in the Boost Build docs as it is that the docs themselves are not geared nearly well enough for the beginning end-user of Boost Build to make it easy for them to understand what you can do with it.
I have no idea how to do the same thing with cmake. As far as I'm aware with cmake you have to set up multiple build directories for each variant of each project. I've found it a real pain for building projects like libc++.
Just to make it clear, I'm far from an expert in boost build, and struggle with many other aspects. But I've never found cmake to be the land of milk and honey that I hear so much about. I'm also more than a bit fed up of cleaning up after other people's grand projects.