Boost logo

Boost-Build :

Subject: Re: [Boost-build] [python] Python build description
From: Spencer E. Olson (olsonse_at_[hidden])
Date: 2010-07-15 12:31:41


This is certainly possible and my little bit of test code that I posted
earlier certainly does that already. In fact, the order of the arguments is
also arbitrary. For example, for a library (and similar for the other
targets) you can do:

library('libname',
    define(FOO='bar'),
    'path/to/src/file0.cpp',
    'path/to/src/file1.c',
    include('path/to/src'),
    define('SOME_DEF'),
    define('BAR=foo'),
    '/path/to/src/file2.asm',
    client_requirements = [
        include('path/to/some-headers'),
        define(CLIENT_USE='true'),
    ],
    if_( toolset('gcc'), define(GCC='1'), include('src0'), 'file_gcc.cpp' ),
    if_( toolset('intel'), define(ICC='1'), include('src1'), 'file_icc.cpp' ),
    link( 'some_file.obj' ),
)

obj( 'some_file.obj', 'some_file_release.cpp', alt( variant('release') ) )
obj( 'some_file.obj', 'some_file_debug.cpp', alt( variant('debug') ) )

I haven't yet tried to implement the conditionals and alternatives syntax.
Just some food for thought...

Spencer

On Thursday 15 July 2010 00:18, Johan Nilsson wrote:
> Steven Watanabe wrote:
> > AMDG
> >
> > Stefan Seefeld wrote:
> >> On 07/14/2010 02:50 PM, Spencer E. Olson wrote:
> >>> --------------------------------- pyJam Example
> >>> -------------------------
> >>> in python (as per the example stuff in my earlier email), you have:
> >>> <<<<<<<< Jamroot.py>>>>>>>>
> >>> from build import *
> >>> project('/myApp',
> >>> define('PROJECT_NAME=myApp'),
> >>> );
> >>
> >> why not
> >>
> >> define(PROJECT_NAME="myApp")
> >>
> >> (i.e., use actual assignment or keyword arguments, rather than an
> >> assignment embedded in a string) ?
> >
> > I think a string is probably better since that allows
> > things like define("BOOST_ALL_NO_LIB") as well.
> > Also, I don't really like relying on the fact that all
> > preprocessor macros are also valid python identifiers.
>
> Using a string does not feel like the optimal solution. I don't know
> Python, but isn't it possible to accept an arbitrary number of parameters
> to the project method (and thus multiple defines or whatever), like:
>
> project('/myApp',
> define('BOOST_ALL_NO_LIB'),
> define('PROJECT_NAME', 'myApp')
> );
>
> / Johan
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build


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