Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-02-27 02:23:15


Hi Matthew,

> I'd like to register a pre-compile test which needs to run before compiling
> our apps. This is to check for required libraries being installed, paths
> set up, etc. The unit test output types are not suitable since they takes
> built executables as a dependency, rather than being an allowable
> dependency themselves.
>
> My approach was to register a file type, say CONFIGURE_CHECK, which would
> contain a shell script that ran and produced a file on success (and no file
> and non-zero error code on failure):
>
> lib my_library
>
> : pre_test.configure_check [ glob *.cpp ]
>
> ...
> ;
>
> This fits well with the bjam file-based dependency design, and I could then
> register a configure_check file type and users would only be forced to
> re-check config on changes to the script.
>
> Question is: how do I make *.configure_check files ignored by the c++
> compilation steps? Is there a modular way to do this? One hack is to just
> output a .o (OBJ) file with no defined symbols, but I'd rather not.

Well, don't put 'pre_test.configure_check' to sources:

  lib my_library
 
     : [ glob *.cpp ]
     : <dependency>pre_test.configure_check
     ;

Assuming your configure check does not puts files into source directory, but
only to build directory, this will have the right effect.

In fact, is there any reason why your configure check creates .o files? I'm
not 100% understand the approach you took.

- Volodya


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