How do you guys pass valued parameter to scons ? I went through its documentation and unfortunately it’s still unclear to me. I’ve never used it before.
Please consider this build script.
Here is code snippet from it
add_option( "boost-version", "boost version for linking(1_38)" , 1 , True , "boostVersion" )
boostVersion = GetOption( "boostVersion" )
if boostVersion is None:
boostVersion = ""
else:
boostVersion = "-" + boostVersion
I tried calling scons --boost-version=1.51 and tried scons --boostVersion=1.51 and none of it worked.
You could use arguments:
You call
scons boost-version=1.51on the commandlineThen, to fetch the value in the SConscript:
or, as elmo suggested:
The scons documentation have more information the same page also describe how to use
AddOptioncommand that you have tried earlier. It can be used also, but arguments are (to me at least) easier to understand.