Boost logo

Boost-Build :

From: Mark Elston (m.elston_at_[hidden])
Date: 2004-06-22 15:15:36


My last email may have been too vague. Let me give a little
more detail. I have also been working with the package a
little since I sent out my last email and have been able
to deal with a part of what I want to do; that is being able
to specify a different set of files for a particular project
depending on the platform I am on.

I have put the relevant information from my existing Jamfiles
and project-root.jam below. Most of the questions I have are
included inline as comments.

I have two main questions. The first is how do I specify different
sets of project settings (<cxxflags>/<linkflags>/etc) based on
release/debug configuration and, also, based on Windows or Linux
builds.

The second question is how do I set variables at the top-level
Jamfile (or project-root.jam) and pick them up in sub-project
Jamfiles?

Any pointers will be appreciated.

>From the top-level Jamfile:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#
# Project root Jamfile
#

# Should these go, instead, in the project-root.jam file?
# Is there a preference? If not, what is that file really for?
project
: requirements
<include>./inc
# Other include directories

# The following are Linux-specific settings.
# I need to add settings for Windows-specific
# compilation and linking as well that will be common
# to all sub-projects. I also need to specify a
# different set based on Release/Debug/Purify configurations.
<cxxflags>-w <cxxflags>-fpic
<linkflags>-fpic
;

# This is the current project I am working on right now.
# However, there are *many* projects with many dependencies.
# Do I have to specify them all here? Is there another way?
# I would like to still be able to specify a single project
# to build from the command-line either at the top level or,
# more likely, at the project directory level.

build-project src/OAI/utils ;

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-end-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The project-root.jam:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

# I have tried putting this in the top-level Jamfile but it
# doesn't seem to matter much. My project-level Jamfiles don't
# seem to be able to pick it up. Why not?
EXT = ;

if debug # or if <variant> = debug , or ...
{
EXT = _D ;
}

# This is used below in trying to get a different extension
# on the resulting libs and exes based on the type of build
# being performed (release/debug/etc).

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-end-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The src/OAI/utils Jamfile:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
import modules ;
ECHO os: [ modules.peek : OS ] ;

project OFC
# : requirements # no separate requirements for now.
;

FILES = ... # list of common files
;

if [ modules.peek : OS ] = LINUX
{
OSFILES = ... # list of Linux-only files
}
else
{
OSFILES = ... # list of Windows-specific files
}

# If I uncomment the next line (commenting the following line)
# I get all kinds of errors running bjam. I want it to pick
# up the EXT variable from the top-level Jamfile or project-root.jam
# file. How can I get this?????

#LIBNAME = libOFC$(EXT) ;
LIBNAME = libOFC ;

lib $(LIBNAME) :
$(FILES) $(OSFILES)
;
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-end-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Mark

---------------------------------------------------------------
Mark Elston
melston_at_[hidden]
---------------------------------------------------------------

 


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