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

Unified Diff: build/gyp_glob.py

Issue 10826171: Incorporate shimming into the irt (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 4 months 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 | src/untrusted/irt/irt.h » ('j') | src/untrusted/irt/irt.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/gyp_glob.py
===================================================================
--- build/gyp_glob.py (revision 0)
+++ build/gyp_glob.py (revision 0)
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+# Copyright 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""This script gets a list of files from the given directory that
+matches a particular glob pattern.
+
+Normal shell globbing does not work with Visual Studio, even if it
+works in Makefiles. Thus we use this python wrapper to handle globbing
+in GYP and get a real list of files instead of a symbolic filename
+that has a "*" in it.
+
+Perhaps this can be built into gyp instead.
jvoung (off chromium) 2012/08/27 21:53:58 If you are asking BradN about the nacl-chrome spli
+"""
+
+import glob
+import os
+import sys
+
+def Main(argv):
+ if len(argv) < 3:
+ sys.stderr.write('Usage: %s <path> <glob_pattern>\n' % argv[0])
+ return 1
+ path = argv[1]
+ glob_str = os.path.join(path, argv[2])
+ files = glob.glob(glob_str)
+ if sys.platform.startswith('win'):
+ # Add a \ so that gyp will have escaped slashes.
+ matching = [ f.replace('\\', '\\\\') for f in files ]
+ else:
+ # Linux seems to need the abspath, while visual studio is okay with
+ # a relative path.
+ matching = [ os.path.abspath(f) for f in files ]
+
+ sys.stdout.write(' '.join(matching) + '\n')
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv))
Property changes on: build/gyp_glob.py
___________________________________________________________________
Added: svn:eol-style
+ LF
Added: svn:executable
+ *
« no previous file with comments | « no previous file | src/untrusted/irt/irt.h » ('j') | src/untrusted/irt/irt.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698