boost.build


In boost build, how to set compiler options conditionally?


Is there a way (without modifying source files) to specify that I want to build boost with, say, msvc with one set of additional options in debug and another in release variants? In some config.jam or even better on command line? Like
using msvc : : <compileflags>-DRELEASE_DEFINES; - only if variant=release
using msvc : : <compileflags>-DDEBUG_DEFINES; - only if variant=debug
using msvc : : <compileflags>-DLL_SPECIFIC_STUFF; - only if link=shared
I was able to find a suggestion to use command line like variant=debug/somefeature=somevalue but that doesn't work.
Well, after some experimentation I was able to make it work through project-config.jam, here's a sample:
import option ;
import toolset ;
using msvc ;
toolset.flags msvc.compile CFLAGS <variant>release : "/GL /arch:SSE2 /fp:fast" : unchecked ;
toolset.flags msvc.compile CFLAGS <variant>debug : "/RTCc /RTC1 /GS" : unchecked ;
toolset.flags msvc.archive AROPTIONS <variant>release/<link>static : "/LTCG" : unchecked ;
toolset.flags msvc.link LINKFLAGS <variant>release/<link>shared : "/LTCG /OPT:REF /OPT:ICF" : unchecked ;
toolset.flags msvc.link LINKFLAGS <link>shared : "/PDB:c:\\Lib\\boost\\stage\\lib\\" : unchecked ;
option.set keep-going : false ;

Related Links

In boost build, how to set compiler options conditionally?

Categories

HOME
oop
alasql
c++builder
app-store
xss
msbi
sugarcrm
angularjs-directive
coding-style
decoding
mbed
opendaylight
infopath
dompdf
bookmarklet
pylint
android-actionbar
loader
printf
accordion
caldav
android-wifi
xna
include-path
lotusscript
hololens
pushbullet
sha
pypy
ios9
textview
urhosharp
choco
imdb
cocoa-scripting
kofax
anypoint-studio
matrix-multiplication
libconfig
scalamock
gem-fury
cowboy
google-chrome-console
nshttpurlresponse
google-chrome-storage
easyquery
gige-sdk
photoshop-script
nservicebus6
hellosign
jtextarea
settext
altova
require-handlebars
qtruby
radar-chart
ewam
dynamics-nav
skscene
ios8-share-extension
android-facebook
event-tracking
self-join
avrcp
vensim
clearquest
waterline
accpac
dockerpy
xmla
sony-xperia
alpha-beta-pruning
cordova-3
information-hiding
diffmerge
react-os
agent-based-modeling
selenium-grid2
pyalgotrade
sqldatasource
class-library
friendly-id
jython-2.5
wpd
ftpwebrequest
moonscript
jquery-ui-map
win-prolog
qvariant
quazip
norton
data-formats
scala-designer
content-delivery-network
unauthorized
software-update
ironpython-studio

Resources

Encrypt Message