Skip to content

Commit

Permalink
Generate response files out of the source tree with xcode & xcode-ninja.
Browse files Browse the repository at this point in the history
Configure generator_filelist_paths used by main gyp input parse to build
path of "<|()" expansions file names when using "xcode" and "xcode-ninja"
generators to be out of the source tree.

The "xcode" generator will put the files in "xcodebuild/gypfiles" while
the "xcode-ninja" generator will use the same algorithm to generate the
file names as "ninja" generator (but using "gypfiles-xcode-ninja" as
last component of the path).

BUG=chromium:562135
R=mark@chromium.org

Review URL: https://codereview.chromium.org/1477333003 .
  • Loading branch information
sdefresne committed Nov 30, 2015
1 parent c385ad6 commit f4d65e3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pylib/gyp/generator/xcode.py
Expand Up @@ -87,6 +87,8 @@
'mac_framework_private_headers',
]

generator_filelist_paths = None

# Xcode's standard set of library directories, which don't need to be duplicated
# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.
xcode_standard_library_dirs = frozenset([
Expand Down Expand Up @@ -578,6 +580,26 @@ def PerformBuild(data, configurations, params):
subprocess.check_call(arguments)


def CalculateGeneratorInputInfo(params):
toplevel = params['options'].toplevel_dir
if params.get('flavor') == 'ninja':
generator_dir = os.path.relpath(params['options'].generator_output or '.')
output_dir = params.get('generator_flags', {}).get('output_dir', 'out')
output_dir = os.path.normpath(os.path.join(generator_dir, output_dir))
qualified_out_dir = os.path.normpath(os.path.join(
toplevel, output_dir, 'gypfiles-xcode-ninja'))
else:
output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild'))
qualified_out_dir = os.path.normpath(os.path.join(
toplevel, output_dir, 'gypfiles'))

global generator_filelist_paths
generator_filelist_paths = {
'toplevel': toplevel,
'qualified_out_dir': qualified_out_dir,
}


def GenerateOutput(target_list, target_dicts, data, params):
# Optionally configure each spec to use ninja as the external builder.
ninja_wrapper = params.get('flavor') == 'ninja'
Expand Down

0 comments on commit f4d65e3

Please sign in to comment.