[Scons-users] [SCons] command line configurations
Harry Cruise
princeharry_89 at yahoo.com
Mon Jul 7 07:50:42 EDT 2014
Hello,
Please help me with the following queries:
1) How to set compiler related flags in scons-y way ?
Say if I have three compiler and two of them are having multiple versions:
a) gcc - version 4.6, 4.4
b) msvc - version 1600, 1700
c) cygwin
There are few flags that helps in setting values for them. But my requirement is if the values are provided in the command line argument then only
set the value otherwise let the scons use default value that it picks
from user's environment.
2) If I use --cc and -cxx for c and c++ compiler respectively(using AddOption) then,
whether values for them should set before initialization of environment ?
As I read that MSVC_VERSION needs to be set during initialization.
I was following some process like:
AddOption('--cc', dest='c_compiler',
default=None,
type='string',
nargs=1,
action='store',
metavar='DIR',
help='C compiler name')
env = Environment()
if c_compiler != None:
env['CC'] = c_compiler
This makes sure to set only if command line value is provided(or not None).Is it correct way of using ?
But How in case of MSVC_VERSION varible ?
I read that it needs to be set during construction as follow:
AddOption('--msvc', dest='msvc_version', default=None, ...)
env = Environment(MSVC_VERSION = GetOption('msvc_version'))
But what if msvc_version is None ?
3) What is "metavar" argument in AddOption function?
4) If I run/use on msvc compiler what is significance of 'CXX' and 'CC' variables ?
Are they still applicable ?
5) How can I use --cc (specified in point (1)), As '-cc' or in some abbreviated way ?
In short I want to know all the clause and process that needs to be follow if I want to make my build script to be work for different compilers
and different versions of them.
I would appreciate if some one could share example methods to do this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140707/50e8a7e7/attachment.html>
More information about the Scons-users
mailing list