mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
Added 'lockfile' option to scons
It uses a lockfile to prevent multiple instances of scons from being run in the same working copy at the same time.
This commit is contained in:
parent
15cc0203d0
commit
068103c765
10
SConstruct
10
SConstruct
@ -90,7 +90,8 @@ opts.AddVariables(
|
||||
BoolVariable('distcc', 'Use distcc', False),
|
||||
BoolVariable('ccache', "Use ccache", False),
|
||||
('cxxtool', 'Set c++ compiler command if not using standard compiler.'),
|
||||
BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False)
|
||||
BoolVariable("fast", "Make scons faster at cost of less precise dependency tracking.", False),
|
||||
BoolVariable("lockfile", "Create a lockfile to prevent multiple instances of scons from being run at the same time on this working copy.", False)
|
||||
)
|
||||
|
||||
#
|
||||
@ -100,6 +101,13 @@ opts.AddVariables(
|
||||
sys.path.insert(0, "./scons")
|
||||
env = Environment(tools=["tar", "gettext", "install", "python_devel", "scanreplace"], options = opts, toolpath = ["scons"])
|
||||
|
||||
if env["lockfile"]:
|
||||
print "Creating lockfile"
|
||||
lockfile = os.path.abspath("scons.lock")
|
||||
open(lockfile, "wx").write(str(os.getpid()))
|
||||
import atexit
|
||||
atexit.register(os.remove, lockfile)
|
||||
|
||||
opts.Save('.scons-option-cache', env)
|
||||
env.SConsignFile("$build_dir/sconsign.dblite")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user