Boost logo

Boost-Build :

Subject: [Boost-build] different macros for same object file
From: Yelve Yakut (yelve_yakut_at_[hidden])
Date: 2009-11-26 13:47:35


I'd like to be able to build two different versions of the same
project, depending on macro definitions. (see example below)
The object files differ depending on a <define> and the problem is
that boost is using the same folder for object files and can not tell
which file is affected by the definition and has to be compiled anew.
Is there a way to tell boost to use another bin directory for the other project?

In the following example the compilation of two projects will result
in the very same executable, depending on which project has been
compiled first.

Yelve Yakut


---- Jamroot ---

alias sharedmem : ...... ;

alias dependencies : .... ;

exe linuxapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies sharedmem ;
install linux : linuxapp : <location>./ ;

exe realtimeapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies
sharedmem : <define>CONTROL_SYSTEM <define>PREEMPT_PATCH ;
install realtime : realtimeapp : <location>./ ;

---- controller.cpp: -----
#include <iostream>
using namespace std;

int main() {
# else
int control_main() {
    cout << "controller" << endl;

---- linapp.cpp: -----
#include <iostream>
using namespace std;

int linapp_main() {
# else
int main() {
    cout << "standard linux app" << endl;

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at