When writing a scons script that will be used on different platform and compiler it's sometimes desired to add compiler specific flags. Fx in pseudo code
if using_gcc:
env.Append( CCFLAGS=["-g"] )
elif using_msvc:
env.Append( CCFLAGS=["/Zi"] )
At an earlier occation I just copied the appropriate(?) .py
files under Tools
and modified these and placed under site_tools
, but that seems like a hackish solution.
Is there a better way to achieve this result? It would of course be nice if it could be added under site_scons
to take global effect (without having to resort to hacking the tools files themselves).
Note: The reason I find it desirable to do this under site_scons
is that it could be done a part of a common build system that is shared among multiple projects. Naturally this means that one have to share this build system among all participants in the project too.