basic support for 'build_always' feature of custom targets

pull/34/head
Axel Waggershauser 10 years ago
parent 67ddeb8a01
commit 963892a7c3
  1. 4
      build.py
  2. 2
      ninjabackend.py

@ -667,7 +667,8 @@ class CustomTarget:
'output' : True,
'command' : True,
'install' : True,
'install_dir' : True}
'install_dir' : True,
'build_always' : True}
def __init__(self, name, subdir, kwargs):
self.name = name
self.subdir = subdir
@ -740,6 +741,7 @@ class CustomTarget:
raise InvalidArguments('"install_dir" must be a string.')
else:
self.install = False
self.build_always = kwargs.get('build_always', False)
def get_basename(self):
return self.name

@ -281,6 +281,8 @@ class NinjaBackend(backends.Backend):
deps = [os.path.join(i.get_subdir(), self.hackety_hack(i.get_filename())) for i in target.get_dependencies()]
srcs = [os.path.join(self.build_to_src, target.subdir, i) for i in target.sources]
deps += srcs
if target.build_always:
deps.append('PHONY')
elem = NinjaBuildElement(ofilenames, 'CUSTOM_COMMAND', deps)
cmd = []
for i in target.command:

Loading…
Cancel
Save