Skip to content
This repository was archived by the owner on Jul 3, 2018. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions positron/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,17 @@ EXTRA_JS_MODULES.renderer['web-view'] += [
'electron/lib/renderer/web-view/web-view-constants.js',
'electron/lib/renderer/web-view/web-view.js',
]

include('/build/gyp.mozbuild')
GYP_DIRS += ['spidernode']
GYP_DIRS['spidernode'].input = 'spidernode/node.gyp'
GYP_DIRS['spidernode'].variables = gyp_vars

# The current incarnation of mozbuild's GYP support resolves include paths
# relative to $topsrcdir/media/webrtc/trunk/build, which is why we need
# to prepend ../../../../ to get to $topsrcdir in them.
# TODO: make mozbuild resolve include paths relative to the moz.build file.
GYP_DIRS['spidernode'].includes += [
'../../../../positron/spidernode/common.gypi',
'../../../../positron/spidernode/config.gypi',
]
2 changes: 2 additions & 0 deletions python/mozbuild/mozbuild/frontend/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,7 @@ def aggregate(files):

'GYP_DIRS': (StrictOrderingOnAppendListWithFlagsFactory({
'variables': dict,
'includes': StrictOrderingOnAppendList,
'input': unicode,
'sandbox_vars': dict,
'non_unified_sources': StrictOrderingOnAppendList,
Expand All @@ -1632,6 +1633,7 @@ def aggregate(files):
object directory.
- variables, a dictionary containing variables and values to pass
to the gyp processor.
- includes, a list of GYP include files (usually .gypi) to include.
- sandbox_vars, a dictionary containing variables and values to
pass to the mozbuild processor on top of those derived from gyp
configuration.
Expand Down
4 changes: 3 additions & 1 deletion python/mozbuild/mozbuild/frontend/gyp_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def encode(value):
return value


def read_from_gyp(config, path, output, vars, non_unified_sources = set()):
def read_from_gyp(config, path, output, vars, non_unified_sources = set(),
incs = set()):
"""Read a gyp configuration and emits GypContexts for the backend to
process.

Expand All @@ -100,6 +101,7 @@ def read_from_gyp(config, path, output, vars, non_unified_sources = set()):
finder = FileFinder(chrome_src, find_executables=False)
includes.extend(encode(mozpath.join(chrome_src, name))
for name, _ in finder.find('*/supplement.gypi'))
includes.extend(encode(mozpath.join(script_dir, inc)) for inc in incs)

# Read the given gyp file and its dependencies.
generator, flat_list, targets, data = \
Expand Down
6 changes: 5 additions & 1 deletion python/mozbuild/mozbuild/frontend/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,12 +1158,16 @@ def _read_mozbuild(self, path, config, descend, metadata):
context)
non_unified_sources.add(source)
time_start = time.time()
incs = set()
for s in getattr(gyp_dir, 'includes', ()):
incs.add(s)
for gyp_context in read_from_gyp(context.config,
mozpath.join(curdir, gyp_dir.input),
mozpath.join(context.objdir,
target_dir),
gyp_dir.variables,
non_unified_sources = non_unified_sources):
non_unified_sources = non_unified_sources,
incs = incs):
gyp_context.update(gyp_dir.sandbox_vars)
gyp_contexts.append(gyp_context)
self._file_count += len(gyp_context.all_paths)
Expand Down