aedi: add zstd target

This commit is contained in:
alexey.lysiuk 2021-06-19 11:59:25 +03:00
parent de98fc3752
commit 5c697333f5
2 changed files with 19 additions and 0 deletions

View file

@ -85,6 +85,7 @@ def targets():
Sdl2TtfTarget(), Sdl2TtfTarget(),
SodiumTarget(), SodiumTarget(),
WebpTarget(), WebpTarget(),
ZstdTarget(),
# Tools # Tools
GmakeTarget(), GmakeTarget(),

View file

@ -408,3 +408,21 @@ class WebpTarget(CMakeStaticDependencyTarget):
def detect(self, state: BuildState) -> bool: def detect(self, state: BuildState) -> bool:
return os.path.exists(state.source + 'src/libwebp.pc.in') return os.path.exists(state.source + 'src/libwebp.pc.in')
class ZstdTarget(CMakeStaticDependencyTarget):
def __init__(self, name='zstd'):
super().__init__(name)
self.src_root = 'build/cmake'
opts = self.options
opts['ZSTD_BUILD_PROGRAMS'] = 'NO'
opts['ZSTD_BUILD_SHARED'] = 'NO'
def prepare_source(self, state: BuildState):
state.download_source(
'https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz',
'5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94')
def detect(self, state: BuildState) -> bool:
return os.path.exists(state.source + 'lib/libzstd.pc.in')