summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Nicholas Swatman <stephen@v25.nl>2024-11-10 21:12:23 +0100
committerGitHub <noreply@github.com>2024-11-10 14:12:23 -0600
commit2da4366ba6b180007976e00ee20d87d19fa0e78d (patch)
tree84e12ddd8933273b08475c4bc5c0b1b4e75e022e
parent2713b0c216cbd4483009e22a5916d843308984fb (diff)
downloadspack-2da4366ba6b180007976e00ee20d87d19fa0e78d.tar.gz
spack-2da4366ba6b180007976e00ee20d87d19fa0e78d.tar.bz2
spack-2da4366ba6b180007976e00ee20d87d19fa0e78d.tar.xz
spack-2da4366ba6b180007976e00ee20d87d19fa0e78d.zip
benchmark: enable shared libraries by default (#47368)
* benchmark: enable shared libraries by default The existing behaviour of Google Benchmark yiels static objects which are of little use for most projects. This PR changes the spec to use dynamic libraries instead. * Add shared variant
-rw-r--r--var/spack/repos/builtin/packages/benchmark/package.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/benchmark/package.py b/var/spack/repos/builtin/packages/benchmark/package.py
index 8e398aefa3..488a750951 100644
--- a/var/spack/repos/builtin/packages/benchmark/package.py
+++ b/var/spack/repos/builtin/packages/benchmark/package.py
@@ -14,6 +14,7 @@ class Benchmark(CMakePackage):
git = "https://github.com/google/benchmark.git"
license("Apache-2.0")
+ maintainers("stephenswat")
# first properly installed CMake config packages in
# 1.2.0 release: https://github.com/google/benchmark/issues/363
@@ -54,6 +55,9 @@ class Benchmark(CMakePackage):
when="@1.5.4:",
description="Enable performance counters provided by libpfm",
)
+ variant(
+ "shared", default=True, sticky=True, description="Build the libraries as shared objects"
+ )
depends_on("cmake@2.8.11:", type="build", when="@:1.1.0")
depends_on("cmake@2.8.12:", type="build", when="@1.2.0:1.4")
@@ -64,6 +68,7 @@ class Benchmark(CMakePackage):
# No need for testing for the install
args = [
self.define("BENCHMARK_ENABLE_TESTING", False),
+ self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("BENCHMARK_ENABLE_LIBPFM", "performance_counters"),
]
return args