diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 19:50:16 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 19:50:16 +0000 |
commit | fdcb3545235dda8086a2655652775596a58e2116 (patch) | |
tree | 50d79be901712ff0a94d31e902751a834169b54f /third_party | |
parent | bbccf6941dff644a9d7bff2622a6f128478535ed (diff) | |
download | chromium_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')
-rwxr-xr-x | third_party/ffmpeg/ffmpeg.gyp | 100 | ||||
-rw-r--r-- | third_party/ffmpeg/ffmpeg.vcproj | 196 | ||||
-rwxr-xr-x | third_party/ffmpeg/generate_libs.bat | 8 | ||||
-rw-r--r-- | third_party/ffmpeg/generate_libs.py | 36 | ||||
-rw-r--r-- | third_party/ffmpeg/generate_libs.rules | 18 |
5 files changed, 136 insertions, 222 deletions
diff --git a/third_party/ffmpeg/ffmpeg.gyp b/third_party/ffmpeg/ffmpeg.gyp new file mode 100755 index 0000000..583d820 --- /dev/null +++ b/third_party/ffmpeg/ffmpeg.gyp @@ -0,0 +1,100 @@ +# Copyright (c) 2009 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. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../../build/common.gypi', + ], + 'target_defaults': { + 'conditions': [ + ['OS!="linux"', {'sources/': [['exclude', '/linux/']]}], + ['OS!="mac"', {'sources/': [['exclude', '/mac/']]}], + ['OS!="win"', {'sources/': [['exclude', '/win/']]}], + ], + }, + 'targets': [ + { + 'target_name': 'ffmpeg', + 'type': 'none', + 'msvs_guid': 'D7A94F58-576A-45D9-A45F-EB87C63ABBB0', + 'sources': [ + 'include/libavcodec/avcodec.h', + 'include/libavcodec/opt.h', + 'include/libavcodec/vdpau.h', + 'include/libavcodec/xvmc.h', + 'include/libavdevice/avdevice.h', + 'include/libavformat/avformat.h', + 'include/libavformat/avio.h', + 'include/libavutil/adler32.h', + 'include/libavutil/avstring.h', + 'include/libavutil/avutil.h', + 'include/libavutil/base64.h', + 'include/libavutil/common.h', + 'include/libavutil/crc.h', + 'include/libavutil/fifo.h', + 'include/libavutil/intfloat_readwrite.h', + 'include/libavutil/log.h', + 'include/libavutil/lzo.h', + 'include/libavutil/mathematics.h', + 'include/libavutil/md5.h', + 'include/libavutil/mem.h', + 'include/libavutil/pixfmt.h', + 'include/libavutil/rational.h', + 'include/libavutil/sha1.h', + 'include/win/inttypes.h', + 'include/win/stdint.h', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + ], + }, + 'conditions': [ + ['OS=="win"', { + 'sources': [ + 'avcodec-52.def', + 'avformat-52.def', + 'avutil-50.def', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include/win', + ], + 'link_settings': { + 'libraries': [ + '<(PRODUCT_DIR)/lib/avcodec-52.lib', + '<(PRODUCT_DIR)/lib/avformat-52.lib', + '<(PRODUCT_DIR)/lib/avutil-50.lib', + ], + }, + }, + 'rules': [ + { + 'rule_name': 'generate_libs', + 'extension': 'def', + 'inputs': [ + 'generate_libs.py', + ], + 'outputs': [ + '<(PRODUCT_DIR)/lib/<(RULE_INPUT_ROOT).lib', + ], + 'variables': { + 'def_files': [ + 'avcodec-52.def', + 'avformat-52.def', + 'avutil-50.def', + ], + }, + 'action': ['python', '<@(_inputs)', '-o', '<(PRODUCT_DIR)/lib', '<@(RULE_INPUT_PATH)'], + 'message': 'Generating import libraries', + }, + ], + }], + ], + }, + ], +} diff --git a/third_party/ffmpeg/ffmpeg.vcproj b/third_party/ffmpeg/ffmpeg.vcproj deleted file mode 100644 index 189b977..0000000 --- a/third_party/ffmpeg/ffmpeg.vcproj +++ /dev/null @@ -1,196 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="ffmpeg" - ProjectGUID="{D7A94F58-576A-45D9-A45F-EB87C63ABBB0}" - RootNamespace="ffmpeg" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - <ToolFile - RelativePath="generate_libs.rules" - /> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - ConfigurationType="10" - InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="include" - > - <Filter - Name="libavcodec" - > - <File - RelativePath=".\include\libavcodec\avcodec.h" - > - </File> - <File - RelativePath=".\include\libavcodec\opt.h" - > - </File> - <File - RelativePath=".\include\libavcodec\vdpau.h" - > - </File> - </Filter> - <Filter - Name="libavformat" - > - <File - RelativePath=".\include\libavformat\avformat.h" - > - </File> - <File - RelativePath=".\include\libavformat\avio.h" - > - </File> - <File - RelativePath=".\include\libavformat\rtsp.h" - > - </File> - <File - RelativePath=".\include\libavformat\rtspcodes.h" - > - </File> - </Filter> - <Filter - Name="libavdevice" - > - <File - RelativePath=".\include\libavdevice\avdevice.h" - > - </File> - </Filter> - <Filter - Name="libavutil" - > - <File - RelativePath=".\include\libavutil\adler32.h" - > - </File> - <File - RelativePath=".\include\libavutil\avstring.h" - > - </File> - <File - RelativePath=".\include\libavutil\avutil.h" - > - </File> - <File - RelativePath=".\include\libavutil\base64.h" - > - </File> - <File - RelativePath=".\include\libavutil\common.h" - > - </File> - <File - RelativePath=".\include\libavutil\crc.h" - > - </File> - <File - RelativePath=".\include\libavutil\fifo.h" - > - </File> - <File - RelativePath=".\include\libavutil\intfloat_readwrite.h" - > - </File> - <File - RelativePath=".\include\libavutil\log.h" - > - </File> - <File - RelativePath=".\include\libavutil\lzo.h" - > - </File> - <File - RelativePath=".\include\libavutil\mathematics.h" - > - </File> - <File - RelativePath=".\include\libavutil\md5.h" - > - </File> - <File - RelativePath=".\include\libavutil\mem.h" - > - </File> - <File - RelativePath=".\include\libavutil\random.h" - > - </File> - <File - RelativePath=".\include\libavutil\rational.h" - > - </File> - <File - RelativePath=".\include\libavutil\sha1.h" - > - </File> - </Filter> - </Filter> - <File - RelativePath=".\avcodec-52.def" - > - </File> - <File - RelativePath=".\avformat-52.def" - > - </File> - <File - RelativePath=".\avutil-50.def" - > - </File> - <File - RelativePath=".\generate_libs.bat" - > - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/third_party/ffmpeg/generate_libs.bat b/third_party/ffmpeg/generate_libs.bat deleted file mode 100755 index 156ae17..0000000 --- a/third_party/ffmpeg/generate_libs.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off - -setlocal -set OUTDIR=%1 - -lib /nologo /machine:X86 /def:avcodec-52.def /out:%OUTDIR%\lib\avcodec-52.lib -lib /nologo /machine:X86 /def:avformat-52.def /out:%OUTDIR%\lib\avformat-52.lib -lib /nologo /machine:X86 /def:avutil-50.def /out:%OUTDIR%\lib\avutil-50.lib 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() diff --git a/third_party/ffmpeg/generate_libs.rules b/third_party/ffmpeg/generate_libs.rules deleted file mode 100644 index d096757..0000000 --- a/third_party/ffmpeg/generate_libs.rules +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="Generate FFmpeg import libraries" - Version="8.00" - > - <Rules> - <CustomBuildRule - Name="Generate FFmpeg import libraries" - CommandLine="generate_libs.bat $(OutDir)" - Outputs="$(OutDir)\lib\avcodec-52.lib" - FileExtensions="*.def" - ExecutionDescription="Generating FFmpeg import libraries..." - > - <Properties> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> |