Disable multithreaded version of zstd by default (#23167)

* Disable multithreaded version of zstd by default

* zstd pthreads by default again! but configurable, and turned off in GCC
This commit is contained in:
Harmen Stoppels 2021-04-21 22:17:08 +02:00 committed by GitHub
parent ee76c329f8
commit 730fbae463
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -122,7 +122,10 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
depends_on('isl@0.15:0.20', when='@9:9.9 +graphite')
depends_on('isl@0.15:', when='@10: +graphite')
depends_on('zlib', when='@6:')
depends_on('zstd', when='@10:')
# GCC only tries to link with -lzstd but it requires
# -pthread too when linking against libzstd.a, so
# disable multithreading by default
depends_on('zstd ~multithread', when='@10:')
depends_on('diffutils', type='build')
depends_on('iconv', when='platform=darwin')
depends_on('gnat', when='languages=ada')

View file

@ -39,6 +39,7 @@ class Zstd(CMakePackage):
variant('zlib', default=False, description='Build programs with zlib support')
variant('lzma', default=False, description='Build programs with lzma support')
variant('lz4', default=False, description='Build programs with zlib support')
variant('multithread', default=True, description='Build with pthread support')
conflicts('+zlib', when='~programs', msg="zlib requires programs to be built")
conflicts('+lzma', when='~programs', msg="lzma requires programs to be built")
@ -53,5 +54,6 @@ def cmake_args(self):
self.define_from_variant('ZSTD_BUILD_PROGRAMS', 'programs'),
self.define_from_variant('ZSTD_BUILD_STATIC', 'static'),
self.define_from_variant('ZSTD_BUILD_SHARED', 'shared'),
self.define_from_variant('ZSTD_LEGACY_SUPPORT', 'legacy')
self.define_from_variant('ZSTD_LEGACY_SUPPORT', 'legacy'),
self.define_from_variant('ZSTD_MULTITHREAD_SUPPORT', 'multithread')
]