Boost logo

Boost-Build :

Subject: [Boost-build] [Boost.Build] Difficulties with conditional targets based on address-model
From: Steven Barbaglia (steven.barbaglia_at_[hidden])
Date: 2014-01-03 06:04:52


I need to have special configuration for 64-bit builds, but conditional
targets with address-model do not work for me. Consider the following
setup where MyLib and MyOtherLib unfortunately fail to include the
desired B class:

File A.cpp:-
class A {};

File B.cpp:-
class B {};

File jamroot.jam:-
alias maybeB : : <address-model>32 ; # default empty
alias maybeB : B.cpp : <address-model>64 ; # include with 64 bit builds only
lib MyLib : A.cpp maybeB ;
lib MyOtherLib : A.cpp : <address-model>64:<source>B.cpp ;
lib MyYetOtherLib : A.cpp : <variant>debug:<source>B.cpp ; # this works,
but is not what is desired

Invocation (used in a VS2013 x64 Cross Tools Command Prompt window):
b2 --toolset=msvc --address-model=64

Outcome:
error: No best alternative for ./maybeB
     next alternative: required properties: <address-model>32
         not matched
     next alternative: required properties: <address-model>64
         not matched
error: No best alternative for ./maybeB
     next alternative: required properties: <address-model>32
         not matched
     next alternative: required properties: <address-model>64
         not matched
...found 17 targets...
...updating 11 targets...
compile-c-c++ bin\msvc-12.0\debug\A.obj
A.cpp
msvc.link.dll bin\msvc-12.0\debug\MyLib.dll
msvc.manifest.dll bin\msvc-12.0\debug\MyLib.dll
msvc.link.dll bin\msvc-12.0\debug\MyOtherLib.dll
msvc.manifest.dll bin\msvc-12.0\debug\MyOtherLib.dll
compile-c-c++ bin\msvc-12.0\debug\B.obj
B.cpp
msvc.link.dll bin\msvc-12.0\debug\MyYetOtherLib.dll
msvc.manifest.dll bin\msvc-12.0\debug\MyYetOtherLib.dll
...updated 11 targets...

Notes
The use of the address-model in the first alternative for maybeB is not
needed, but was introduced to highlight the "No best alternative" error,
a possible clue to the problem. The 64-bit alternative is never chosen,
even when using the more conventional definition with no required
properties in the first alternative for maybeB.
If I remove the first alternative for maybe, then 64-bit builds include
B, but unfortunately also 32-bit builds include B (no error reported).
Using "Boost.Build 2011.12-svn"

Regards
Steven

-----------------------------------------------------------------
Sinara builds cost-effective computer applications. We are experts in systems for financial market data, real-time transaction processing, Internet technology and relational databases. We have over 20 years' experience of providing quality IT solutions to a global client base.

http://www.sinara.com
mailto:info_at_[hidden]
+44 20 7940 7950

Disclaimer. This e-mail message (and any attachments) is confidential and may contain privileged information. It is for the intended recipient only. If you are not the intended recipient, you must not copy, distribute or use any of the information in it. If you receive this message in error please notify us as soon as possible and delete it. Copyright in this e-mail and attachments created by us belongs to Sinara Consultants Limited. Internet e-mails are not secure. Sinara does not accept responsibility for changes made to this message after it was sent. Should you communicate with anyone at Sinara by email you consent to us monitoring and reading any such correspondence.


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