From f4d65e35719cfe02257ece126c109cfc053ca35c Mon Sep 17 00:00:00 2001 From: Sylvain Defresne Date: Mon, 30 Nov 2015 16:57:31 +0100 Subject: [PATCH] Generate response files out of the source tree with xcode & xcode-ninja. 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 . --- pylib/gyp/generator/xcode.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py index 3136f7c2..879929d1 100644 --- a/pylib/gyp/generator/xcode.py +++ b/pylib/gyp/generator/xcode.py @@ -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([ @@ -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'