Bug 1162852 - Don't set IS_GYP_DIR from the gyp_reader. r=gps

With TemplateContexts keeping the name of the associated template, and the
Gyp context being declared as a TemplateContext, it is now possible to know
the equivalent of IS_GYP_DIR just by looking at the template name.
This commit is contained in:
Mike Hommey 2015-05-08 13:40:14 +09:00
Родитель 8a0ffdf337
Коммит 82a36b3780
2 изменённых файлов: 4 добавлений и 4 удалений

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

@ -79,6 +79,7 @@ from .reader import SandboxValidationError
from .context import ( from .context import (
Context, Context,
SubContext, SubContext,
TemplateContext,
) )
@ -560,7 +561,6 @@ class TreeMetadataEmitter(LoggingMixin):
'EXTRA_PP_COMPONENTS', 'EXTRA_PP_COMPONENTS',
'FAIL_ON_WARNINGS', 'FAIL_ON_WARNINGS',
'USE_STATIC_LIBS', 'USE_STATIC_LIBS',
'IS_GYP_DIR',
'NO_DIST_INSTALL', 'NO_DIST_INSTALL',
'PYTHON_UNIT_TESTS', 'PYTHON_UNIT_TESTS',
'RCFILE', 'RCFILE',
@ -591,6 +591,9 @@ class TreeMetadataEmitter(LoggingMixin):
if context['NO_VISIBILITY_FLAGS']: if context['NO_VISIBILITY_FLAGS']:
passthru.variables['VISIBILITY_FLAGS'] = '' passthru.variables['VISIBILITY_FLAGS'] = ''
if isinstance(context, TemplateContext) and context.template == 'Gyp':
passthru.variables['IS_GYP_DIR'] = True
for obj in self._process_sources(context, passthru): for obj in self._process_sources(context, passthru):
yield obj yield obj

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

@ -71,7 +71,6 @@ class GypContext(TemplateContext):
# Using a class method instead of a class variable to hide the content # Using a class method instead of a class variable to hide the content
# from sphinx. # from sphinx.
return dict(VARIABLES, return dict(VARIABLES,
IS_GYP_DIR=(bool, bool, '', None),
EXTRA_ASSEMBLER_FLAGS=(List, list, '', None), EXTRA_ASSEMBLER_FLAGS=(List, list, '', None),
EXTRA_COMPILE_FLAGS=(List, list, '', None), EXTRA_COMPILE_FLAGS=(List, list, '', None),
) )
@ -148,8 +147,6 @@ def read_from_gyp(config, path, output, vars, non_unified_sources = set()):
context.add_source(mozpath.abspath(mozpath.join( context.add_source(mozpath.abspath(mozpath.join(
mozpath.dirname(build_file), f))) mozpath.dirname(build_file), f)))
context['IS_GYP_DIR'] = True
spec = targets[target] spec = targets[target]
# Derive which gyp configuration to use based on MOZ_DEBUG. # Derive which gyp configuration to use based on MOZ_DEBUG.