summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDaryl W. Grunau <DarylGrunau@gmail.com>2018-06-07 09:34:37 -0600
committerAdam J. Stewart <ajstewart426@gmail.com>2018-06-07 10:34:37 -0500
commita6e0837b3173354af6785adb2fd7afa89f16e485 (patch)
treeb5793dd87e6cf620edb10809e55b0d6569855dca /var
parentb5a48f44bca6fb061e34250a63cce56b77d861f4 (diff)
downloadspack-a6e0837b3173354af6785adb2fd7afa89f16e485.tar.gz
spack-a6e0837b3173354af6785adb2fd7afa89f16e485.tar.bz2
spack-a6e0837b3173354af6785adb2fd7afa89f16e485.tar.xz
spack-a6e0837b3173354af6785adb2fd7afa89f16e485.zip
googletest: add a shared variant for all supported versions (#8373)
* add a shared variant for all supported versions * address comment from @citibeth about MacOS lib installs * address additional comments from @citibeth about MacOS lib installs * set +shared variant to be default behavior
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/googletest/package.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/googletest/package.py b/var/spack/repos/builtin/packages/googletest/package.py
index 4651ea7c3e..67edb2dc2e 100644
--- a/var/spack/repos/builtin/packages/googletest/package.py
+++ b/var/spack/repos/builtin/packages/googletest/package.py
@@ -39,6 +39,8 @@ class Googletest(CMakePackage):
variant('pthreads', default=True,
description='Build multithreaded version with pthreads')
+ variant('shared', default=True,
+ description='Build shared libraries (DLLs)')
def cmake_args(self):
spec = self.spec
@@ -55,6 +57,8 @@ class Googletest(CMakePackage):
options.append('-Dgtest_disable_pthreads={0}'.format(
'ON' if '+pthreads' in spec else 'OFF'))
+ options.append('-DBUILD_SHARED_LIBS={0}'.format(
+ 'ON' if '+shared' in spec else 'OFF'))
return options
@when('@:1.7.0')
@@ -67,5 +71,9 @@ class Googletest(CMakePackage):
prefix.include)
mkdirp(prefix.lib)
- install('libgtest.a', prefix.lib)
- install('libgtest_main.a', prefix.lib)
+ if '+shared' in spec:
+ install('libgtest.{0}'.format(dso_suffix), prefix.lib)
+ install('libgtest_main.{0}'.format(dso_suffix), prefix.lib)
+ else:
+ install('libgtest.a', prefix.lib)
+ install('libgtest_main.a', prefix.lib)