Use env.AddMethod to add custom methods.

This commit is contained in:
Sergey Popov 2009-03-20 20:49:23 +00:00
parent aeca9d33bd
commit 45e1f336a1
5 changed files with 7 additions and 12 deletions

View file

@ -34,5 +34,4 @@ def WindowsInstaller(env, files):
env.Alias("windows-installer", [files, "#/Wesnoth.nsi"], "makensis ${SOURCES[-1]}")
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.WindowsInstaller = WindowsInstaller
env.AddMethod(WindowsInstaller)

View file

@ -43,8 +43,7 @@ def generate(env):
return env.MsgMerge(target, source)
else:
return env.MsgInit(target, source)
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.MsgInitMerge = MsgInitMerge
env.AddMethod(MsgInitMerge)
env["PO4A_GETTEXTIZE"] = WhereIs("po4a-gettextize")
po4a_gettextize = Builder(

View file

@ -102,10 +102,8 @@ def InstallData(env, datadir, component, source, subdir = ""):
env.Alias("install-" + component, install)
def generate(env):
#env.AddMethod(InstallWithSuffix)
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.InstallBinary = InstallBinary
SConsEnvironment.InstallData = InstallData
env.AddMethod(InstallBinary)
env.AddMethod(InstallData)
env.Append(BUILDERS={'InstallFiltered':Builder(action=InstallFilteredHook, target_factory=Dir, source_factory=Dir)})

View file

@ -10,8 +10,7 @@ def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kv)
def generate(env):
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.PythonExtension = PythonExtension
env.AddMethod(PythonExtension)
def CheckPython(context):
env = context.env

View file

@ -302,8 +302,8 @@ def WesnothProgram(env, target, source, can_build, **kw):
exec target + " = bin"
Export(target)
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.WesnothProgram = WesnothProgram
env.AddMethod(WesnothProgram)
test_env.AddMethod(WesnothProgram)
game_cpp = env.Object("game.cpp", EXTRA_DEFINE = not env["pool_alloc"] and "DISABLE_POOL_ALLOC" or None);