libgit2: add mmap variant, disabling it makes it work on filesystems that do not implement mmap (#28520)
This commit is contained in:
parent
932408ac2b
commit
4134b318ac
@ -57,6 +57,8 @@ class Libgit2(CMakePackage):
|
|||||||
variant('ssh', default=True, description='Enable SSH support')
|
variant('ssh', default=True, description='Enable SSH support')
|
||||||
variant('curl', default=False, description='Enable libcurl support (only supported through v0.27)')
|
variant('curl', default=False, description='Enable libcurl support (only supported through v0.27)')
|
||||||
|
|
||||||
|
variant('mmap', default=True, description='Enable mmap support', when='@1.1.1:')
|
||||||
|
|
||||||
# Build Dependencies
|
# Build Dependencies
|
||||||
depends_on('cmake@2.8:', type='build', when="@:0.28")
|
depends_on('cmake@2.8:', type='build', when="@:0.28")
|
||||||
depends_on('cmake@3.5:', type='build', when="@0.99:")
|
depends_on('cmake@3.5:', type='build', when="@0.99:")
|
||||||
@ -71,6 +73,11 @@ class Libgit2(CMakePackage):
|
|||||||
|
|
||||||
conflicts('+curl', when='@0.28:')
|
conflicts('+curl', when='@0.28:')
|
||||||
|
|
||||||
|
def flag_handler(self, name, flags):
|
||||||
|
if name == 'cflags' and not self.spec.variants.get('mmap', False):
|
||||||
|
flags.append('-DNO_MMAP')
|
||||||
|
return (flags, None, None)
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
args = []
|
args = []
|
||||||
if 'https=system' in self.spec:
|
if 'https=system' in self.spec:
|
||||||
|
Loading…
Reference in New Issue
Block a user