Bug 1384241 - Pre: Extract acdefines() helper function. r=gps

MozReview-Commit-ID: 6TstvuluvH3

--HG--
extra : rebase_source : de26dd98836ec49d0abc93052e84b6a90b3e248f
This commit is contained in:
Nick Alexander 2017-07-26 19:31:18 -07:00
Родитель 69706d3a85
Коммит e2b0d989a6
2 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -12,7 +12,10 @@ from types import StringTypes, ModuleType
import mozpack.path as mozpath
from mozbuild.util import ReadOnlyDict
from mozbuild.util import (
memoized_property,
ReadOnlyDict,
)
from mozbuild.shellutil import quote as shell_quote
@ -194,6 +197,13 @@ class ConfigEnvironment(object):
def is_artifact_build(self):
return self.substs.get('MOZ_ARTIFACT_BUILDS', False)
@memoized_property
def acdefines(self):
acdefines = dict((name, self.defines[name])
for name in self.defines
if name not in self.non_global_defines)
return ReadOnlyDict(acdefines)
@staticmethod
def from_config_status(path):
config = BuildConfig.from_config_status(path)

Просмотреть файл

@ -236,11 +236,8 @@ class TupOnly(CommonBackend, PartialBackend):
pass
with self._write_file(mozpath.join(self.environment.topobjdir, 'Tuprules.tup')) as fh:
acdefines = [name for name in self.environment.defines
if not name in self.environment.non_global_defines]
acdefines_flags = ' '.join(['-D%s=%s' % (name,
shell_quote(self.environment.defines[name]))
for name in sorted(acdefines)])
acdefines_flags = ' '.join(['-D%s=%s' % (name, shell_quote(value))
for (name, value) in sorted(self.environment.acdefines.iteritems())])
# TODO: AB_CD only exists in Makefiles at the moment.
acdefines_flags += ' -DAB_CD=en-US'