googletest: add variant to enable/disable threads (#8052)
Add Google Test variant to enable/disable building with threads.
This commit is contained in:
parent
0ac777b88e
commit
ca9ce8048c
@ -37,6 +37,9 @@ class Googletest(CMakePackage):
|
|||||||
variant('gmock', default=False, description='Build with gmock')
|
variant('gmock', default=False, description='Build with gmock')
|
||||||
conflicts('+gmock', when='@:1.7.0')
|
conflicts('+gmock', when='@:1.7.0')
|
||||||
|
|
||||||
|
variant('pthreads', default=True,
|
||||||
|
description='Build multithreaded version with pthreads')
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
if '@1.8.0:' in spec:
|
if '@1.8.0:' in spec:
|
||||||
@ -49,6 +52,9 @@ def cmake_args(self):
|
|||||||
else:
|
else:
|
||||||
# Old style (contains only GTest)
|
# Old style (contains only GTest)
|
||||||
options = []
|
options = []
|
||||||
|
|
||||||
|
options.append('-Dgtest_disable_pthreads={0}'.format(
|
||||||
|
'ON' if '+pthreads' in spec else 'OFF'))
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@when('@:1.7.0')
|
@when('@:1.7.0')
|
||||||
|
Loading…
Reference in New Issue
Block a user