|
Boost-Build : |
Subject: Re: [Boost-build] Different builds for XP and Vista/7
From: Artem Alimarine (brakoziabr_at_[hidden])
Date: 2011-04-17 15:42:57
Ok, the problem had to do with static linking. Your example works at my
place as you described. It did not work with link=static. (I had static
linking ordered somewhere in a project clause. Sorry for not reporting it.)
Now it works as expected also with static linking with the Jamroot
pasted below. Note that I added propagated and symmetric to the feature
attributes. If I understand correctly, these attributes are needed to
force separate build trees for each flavor.
Thanks for help,
Artem
---------------------------------
import feature ;
feature.subfeature target-os windows : flavor : vista xp : composite
optional symmetric propagated ;
feature.compose <target-os-windows:flavor>vista :
<define>_WIN32_WINNT=0x0600 ;
feature.compose <target-os-windows:flavor>xp :
<define>_WIN32_WINNT=0x0501 ;
project foo
: requirements
<link>static # linking of own code
<runtime-link>static # linking of
runtime libraries
<threading>multi # multithreaded runtime
: usage-requirements
: #build-dir
: default-build
<toolset>msvc
<target-os>windows-vista
<target-os>windows-xp
;
lib foo_lib : foo_xp.cpp : <target-os-windows:flavor>xp ;
lib foo_lib : foo_vista.cpp : <target-os-windows:flavor>vista ;
#lib foo_lib ;
exe main : main.cpp foo_lib ;
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