summaryrefslogtreecommitdiffstats
path: root/third_party/ffmpeg/generate_libs.py
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 19:50:16 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 19:50:16 +0000
commitfdcb3545235dda8086a2655652775596a58e2116 (patch)
tree50d79be901712ff0a94d31e902751a834169b54f /third_party/ffmpeg/generate_libs.py
parentbbccf6941dff644a9d7bff2622a6f128478535ed (diff)
downloadchromium_src-fdcb3545235dda8086a2655652775596a58e2116.zip
chromium_src-fdcb3545235dda8086a2655652775596a58e2116.tar.gz
chromium_src-fdcb3545235dda8086a2655652775596a58e2116.tar.bz2
Convert /third_party/ffmpeg to gyp for Windows builds.
To smooth out the transition I left in using_ffmpeg.vsprops until the rest of Windows switches over to gyp. I also took the opportunity to ditch the .bat file in favour of python. Review URL: http://codereview.chromium.org/63054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/ffmpeg/generate_libs.py')
-rw-r--r--third_party/ffmpeg/generate_libs.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/third_party/ffmpeg/generate_libs.py b/third_party/ffmpeg/generate_libs.py
new file mode 100644
index 0000000..9a8faeb
--- /dev/null
+++ b/third_party/ffmpeg/generate_libs.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+# Generates MSVC import libraries from .def files. Assumes MSVC environment
+# has been loaded.
+
+import optparse
+import os
+import subprocess
+
+def main():
+ parser = optparse.OptionParser(usage='usage: %prog [options] input')
+ parser.add_option('-o',
+ '--output',
+ dest='output',
+ default=None,
+ help=('output location'))
+ (options, args) = parser.parse_args()
+
+ if options.output == None:
+ parser.error('Output location not specified')
+ if len(args) == 0:
+ parser.error('No inputs specified')
+
+ # Make sure output directory exists.
+ if not os.path.exists(options.output):
+ os.makedirs(options.output)
+
+ # Run lib.exe on each input def file.
+ for input_path in args:
+ input_name = os.path.basename(input_path)
+ input_root = os.path.splitext(input_name)[0]
+ output_path = os.path.join(options.output, input_root + '.lib')
+ subprocess.call(['lib', '/nologo', '/machine:X86', '/def:' + input_path,
+ '/out:' + output_path])
+
+if __name__ == '__main__':
+ main()