Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-05-22 14:22:12


Boris Kolpackov wrote:
> Hm, in my experience it's the other way around: end-users find it too tedious
> to remember the sequence of options to enable the right set of warnings for
> each compiler, etc. On the other hand, how often do you write a test that
> needs to be built with exceptions disables...

Maybe not very often, but each time a user reports "your library doesn't
compile/work with exceptions disabled."

That's perhaps not as frequent as "your library doesn't compile with -Werror"
but it does happen.

> ... and how hard is it to specify the
> actual options for essentially two classes of C++ compilers: MSVC and
> everything else?

boost_test already solves this, as it's smart enough to translate some
compile options to msvc-ese

https://github.com/boostorg/cmake/blob/6dcde32c82f7c1fef67b6e61db862f73e4809210/include/BoostTest.cmake#L118-L135

but that's not quite the same as having built-in support. b2, for instance,
allows me to do this

run my_test.cpp : : : <target-os>darwin,<undefined-sanitizer>norecover:<build>no ;

which isn't as convenient with a flag soup.

Expressing something like this, for example

https://github.com/boostorg/throw_exception/blob/7c8ec2114bc1f9ab2a8afbd629b96fbdd5901294/test/Jamfile.v2#L39-L45

with CMake is much more verbose and not as general.


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