build script: add webp target

This commit is contained in:
alexey.lysiuk 2020-12-16 10:56:38 +02:00
parent 5b46f1e5f3
commit 5bd972bc43
2 changed files with 28 additions and 0 deletions

3
.gitignore vendored
View file

@ -46,6 +46,9 @@
/deps/sndfile/bin/
/deps/sndfile/include/sndfile.hh
/deps/sndfile/lib/cmake/
/deps/webp/include/webp/demux.h
/deps/webp/**/libwebpdecoder.*
/deps/webp/**/libwebpdemux.*
/deps/yasm/bin/vsyasm
/deps/yasm/bin/ytasm
/deps/yasm/include/

View file

@ -1241,6 +1241,30 @@ class VpxTarget(ConfigureMakeDependencyTarget):
return os.path.exists(builder.source_path + 'vpxstats.h')
class WebpTarget(CMakeStaticDependencyTarget):
def __init__(self, name='webp'):
super().__init__(name)
opts = self.options
opts['WEBP_BUILD_ANIM_UTILS'] = 'NO'
opts['WEBP_BUILD_CWEBP'] = 'NO'
opts['WEBP_BUILD_DWEBP'] = 'NO'
opts['WEBP_BUILD_GIF2WEBP'] = 'NO'
opts['WEBP_BUILD_IMG2WEBP'] = 'NO'
opts['WEBP_BUILD_VWEBP'] = 'NO'
opts['WEBP_BUILD_WEBPINFO'] = 'NO'
opts['WEBP_BUILD_WEBPMUX'] = 'NO'
opts['WEBP_BUILD_EXTRAS'] = 'NO'
def prepare_source(self, builder: 'Builder'):
builder.download_source(
'https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz',
'98a052268cc4d5ece27f76572a7f50293f439c17a98e67c4ea0c7ed6f50ef043')
def detect(self, builder: 'Builder') -> bool:
return os.path.exists(builder.source_path + 'src/libwebp.pc.in')
class YasmTarget(ConfigureMakeDependencyTarget):
def __init__(self, name='yasm'):
super().__init__(name)
@ -1566,6 +1590,7 @@ class Builder(object):
SndFileTarget(),
VorbisTarget(),
VpxTarget(),
WebpTarget(),
YasmTarget(),
ZlibTarget(),
ZMusicTarget(),