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

Side by Side Diff: build/gyp_glob.py

Issue 8817001: Make a gyp file for the pnacl_irt_shim. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Move one gyp file to chrome Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/all.gyp ('k') | build/untrusted.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """This script gets a list of files from the given directory that
7 matches a particular glob pattern.
8
9 Normal shell globbing does not work with Visual Studio, even if it
10 works in Makefiles. Thus we use this python wrapper to handle globbing
11 in GYP and get a real list of files instead of a symbolic filename
12 that has a "*" in it.
13
14 Perhaps this can be built into gyp instead.
15 """
16
17 import glob
18 import os
19 import sys
20
21 def Main(argv):
22 if len(argv) < 3:
23 sys.stderr.write('Usage: %s <path> <glob_pattern>\n' % argv[0])
24 return 1
25 path = argv[1]
26 glob_str = os.path.join(path, argv[2])
27 files = glob.glob(glob_str)
28 if sys.platform.startswith('win'):
29 # Add a \ so that gyp will have escaped slashes.
30 matching = [ f.replace('\\', '\\\\') for f in files ]
31 else:
32 # Linux seems to need the abspath, while visual studio is okay with
33 # a relative path.
34 matching = [ os.path.abspath(f) for f in files ]
35
36 sys.stdout.write(' '.join(matching) + '\n')
37 return 0
38
39 if __name__ == '__main__':
40 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « build/all.gyp ('k') | build/untrusted.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698