Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Unified Diff: build/gyp_chromium

Issue 62803003: Run GN as part of runhooks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/gyp_chromium
diff --git a/build/gyp_chromium b/build/gyp_chromium
index 3a4fb1af690597e4895e4ab91cc626ab06890417..965c53894c6d8019c934bb70418aeb7d67a12a06 100755
--- a/build/gyp_chromium
+++ b/build/gyp_chromium
@@ -79,6 +79,31 @@ def additional_include_files(args=[]):
return result
M-A Ruel 2013/11/14 23:23:36 2 lines between file level symbols
+def RunGN():
+ """Runs GN, returning True if it succeeded, printing an error and returning
+ false if not."""
+ # The binaries in platform-specific subdirectories in src/tools/gn/bin.
+ # We assume this file is in one subdirectory of the source root.
+ source_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
M-A Ruel 2013/11/14 23:23:36 It's highly preferable to create a global variable
+ gnpath = source_root + '/tools/gn/bin/'
+ if sys.platform == 'win32':
+ gnpath += 'win/gn.exe'
+ elif sys.platform.startswith('linux'):
+ gnpath += 'linux/gn'
+ elif sys.platform == 'darwin':
+ gnpath += 'mac/gn'
+ else:
+ print 'Unknown platform for GN: ', sys.platform
+ return False
+
+ print 'Generating gyp files from GN...'
+
+ # Need to pass both the source root (the bots don't run this command from
+ # within the source tree) as well as set the is_gyp value so the BUILD files
+ # to know they're being run under GYP.
+ args = [gnpath, 'gyp', '-q', '--root=' + chrome_src, '--args=is_gyp=true']
+ return subprocess.call(args) == 0
+
M-A Ruel 2013/11/14 23:23:36 2 lines
if __name__ == '__main__':
args = sys.argv[1:]
@@ -87,6 +112,9 @@ if __name__ == '__main__':
psyco.profile()
print "Enabled Psyco JIT."
+ if not RunGN():
+ sys.exit(1)
+
# Fall back on hermetic python if we happen to get run under cygwin.
# TODO(bradnelson): take this out once this issue is fixed:
# http://code.google.com/p/gyp/issues/detail?id=177
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698