|
Boost-Build : |
Subject: Re: [Boost-build] discovering libraries with boost at build time
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-07-12 11:40:19
> Of course, I can add some higher-level wrapper.
Here's a first cut at high level wrappers (attached).
Note that the new rules, their tests, and an example (which shows how to
configure the z library) are all in the same Jamfile, so I suggest new users
scroll to the end and read the short example first.
The new rules currently supported are:
try_compile_src ( description + : file : true-opts * : false-opts * :
properties * )
try_compile ( description + : code : true-opts * : false-opts * :
properties * )
try_link_src ( description + : files : true-opts * : false-opts *
: properties * )
try_link ( description + : code : true-opts * : false-opts *
: properties * )
try_run_src ( description + : files : true-opts * : false-opts * :
properties * )
try_run ( description + : code : true-opts * : false-opts *
: properties * )
The *_src versions all accept source files with which to conduct the test,
while the others take a string "code" that contains the actual C++ code to
test - that means you can define the tests inline in the Jamfile if you
want, rather like with autoconf.
You can either place these rules directly in the requirements section of the
target that needs them, or you can assign the result of these rules to a
variable, and then use that variable in however many targets need it.
Enjoy, John.
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk