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

Side by Side Diff: chromium/scripts/generate_libs.py

Issue 9290059: Initial commit of all previous Chrome build scripts. (Closed) Base URL: http://git.chromium.org/chromium/third_party/ffmpeg.git@master
Patch Set: Drop deprecated subfolder. Created 8 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Generates MSVC import libraries from .def files. Assumes MSVC environment
3 # has been loaded.
4
5 import optparse
6 import os
7 import subprocess
8
9 def main():
10 parser = optparse.OptionParser(usage='usage: %prog [options] input')
11 parser.add_option('-o',
12 '--output',
13 dest='output',
14 default=None,
15 help=('output location'))
16 (options, args) = parser.parse_args()
17
18 if options.output == None:
19 parser.error('Output location not specified')
20 if len(args) == 0:
21 parser.error('No inputs specified')
22
23 # Make sure output directory exists.
24 if not os.path.exists(options.output):
25 os.makedirs(options.output)
26
27 # Run lib.exe on each input def file.
28 for input_path in args:
29 input_name = os.path.basename(input_path)
30 input_root = os.path.splitext(input_name)[0]
31 output_path = os.path.join(options.output, input_root + '.lib')
32 subprocess.call(['lib', '/nologo', '/machine:X86', '/def:' + input_path,
33 '/out:' + output_path])
34
35 if __name__ == '__main__':
36 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698