Add program and sconscript tools
This commit is contained in:
parent
bd7a79c9e1
commit
e1c4e0c4b7
4 changed files with 87 additions and 8 deletions
36
site_scons/site_tools/sconscript.py
Normal file
36
site_scons/site_tools/sconscript.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# sconscript.py
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
'''
|
||||
SCons tool for working with SConscripts.
|
||||
'''
|
||||
|
||||
import SCons.Script
|
||||
|
||||
def _do_sconscript(env):
|
||||
original_sconscript = env.SConscript
|
||||
|
||||
def sconscript(env, sconscript, clone=False, *args, **kwargs):
|
||||
exports = {'Library': env.Library,
|
||||
'StaticLibrary': env.StaticLibrary,
|
||||
'SharedLibrary': env.SharedLibrary,
|
||||
'Program': env.Program}
|
||||
SCons.Script._SConscript.GlobalDict.update(exports)
|
||||
env.log('Reading {}'.format(sconscript))
|
||||
return original_sconscript(sconscript,
|
||||
{'env': env.Clone() if clone else env},
|
||||
*args,
|
||||
**kwargs)
|
||||
|
||||
return sconscript
|
||||
|
||||
#
|
||||
# SCons tool interface
|
||||
#
|
||||
|
||||
def generate(env):
|
||||
env.AddMethod(_do_sconscript(env), 'SConscript')
|
||||
|
||||
|
||||
def exists(env):
|
||||
return True
|
Loading…
Add table
Add a link
Reference in a new issue