Boost logo

Boost :

Subject: [boost] [predef] Announce: Build time configuration for Predef defs.
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2015-01-27 16:29:56


Following on the concept by Peter Dimov of using the BBv2 config feature
combined with tests I'm pleased to announce that Predef now has a similar
feature.

In the develop branch of Predef you can now do the following:

  import ../libs/predef/check/predef : require : predef-require ;
  run macos_only_test.cpp : : : [ predef-require "BOOST_OS_MACOS" ] ;
  run vc15_only_test.cpp : : : [ predef-require "BOOST_COMP_MSVC >= 15.0.0"
] ;

The expression(s) to check can use any of the definitions that Predef has.
The general for is: "<DEF> <OP> <VERSION>". Where <OP> is any of the usual
C/C++ relational operators. And <VERSION> is a partial or complete triplet
of integers. You can specify multiple checked expressions that are all
required. Also part of this is a more general "check" rule that allows for
custom build requirements. For example:

  import ../libs/predef/check/predef : require check : predef-require
predef-check ;
  run macos_only_test.cpp : : : [ predef-require "BOOST_OS_MACOS" ] ;
  run vc15_only_test.cpp : : : [ predef-check "BOOST_COMP_MSVC >= 15.0.0" :
<define>THIS_IS_MSVC : <build>no ] ;

I'll put this into master as soon as I have appropriate documentation.

Enjoy.

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

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