Boost logo

Boost :

Subject: [boost] [build] Conditional sources and compiler options
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-05-04 04:39:36


Hi,

I'm trying to add some SIMD support to my library and I'm having problems with
setting up my Jamfile properly.

Basically, I have a number of source files that only need to be compiled when
the compiler is of a specific version or later (say, gcc >= 4.7 or msvc >= 12
or intel >= X.Y on x86 but not for other compilers/architectures and not for
older versions of the mentioned compilers). Next, I need to add special
compiler options (specific for each compiler) just for these files. Natuarlly,
I also have other source files that need not these tricks and should be
compiled normally, without any special options. All source files have to be
compiled into a single library (static or dynamic).

Is there any way to do it in Boost.Build? I've read about alternatives in the
docs, but they require duplicating the library target, which I'd like to
avoid. I also read about conditional requirements, but as I understand they
don't allow to specify version conditions (like <toolset>gcc >= 4.7). Also I
didn't find any way to specify special build options for particular files.

Thanks in advance.


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