Skip to content
Snippets Groups Projects
Commit 197c82b7 authored by Dirk Pranke's avatar Dirk Pranke
Browse files

Patch GYP so that building with Xcode 10 works.

Specifically, this change makes it so that rules explicitly list
 their outputs in the generated Xcode project.

Previously, rules added to Xcode did not list their outputs and this
worked fine because make handled everything correctly. However due to
recent build system improvements made by Apple
(https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes/build_system_release_notes_for_xcode_10?language=objc)
only files explicitly listed as outputs can be referenced in build
targets.

"If an output file which is generated by a shell script is used as an
input elsewhere in the build (for example, to another shell script),
then that output must be declared as an explicit output by the script
that generates it; otherwise the build system may attempt to search for
the file before it has been generated, causing the build to fail."

Change-Id: Ia5c9e8ef604e4268755f11a33ccd2ea9564fd0fe
Reviewed-on: https://chromium-review.googlesource.com/c/1318929


Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
parent 81286d38
No related branches found
No related tags found
No related merge requests found
......@@ -1094,17 +1094,6 @@ def GenerateOutput(target_list, target_dicts, data, params):
# work if there ever was a concrete output that had an input-dependent
# variable anywhere other than in the leaf position.
# Don't declare any inputPaths or outputPaths. If they're present,
# Xcode will provide a slight optimization by only running the script
# phase if any output is missing or outdated relative to any input.
# Unfortunately, it will also assume that all outputs are touched by
# the script, and if the outputs serve as files in a compilation
# phase, they will be unconditionally rebuilt. Since make might not
# rebuild everything that could be declared here as an output, this
# extra compilation activity is unnecessary. With inputPaths and
# outputPaths not supplied, make will always be called, but it knows
# enough to not do anything when everything is up-to-date.
# To help speed things up, pass -j COUNT to make so it does some work
# in parallel. Don't use ncpus because Xcode will build ncpus targets
# in parallel and if each target happens to have a rules step, there
......@@ -1120,7 +1109,9 @@ exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}"
exit 1
""" % makefile_name
ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({
'inputPaths': rule['rule_sources'],
'name': 'Rule "' + rule['rule_name'] + '"',
'outputPaths': concrete_outputs_all,
'shellScript': script,
'showEnvVarsInLog': 0,
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment