Add shared variant for fftw to allow static-only builds (#37897)

Co-authored-by: alexrichert <alexrichert@gmail.com>
This commit is contained in:
Alex Richert 2024-04-04 02:47:46 -07:00 committed by GitHub
parent cb315e18f0
commit 2b3e7fd10a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,6 +25,7 @@ class FftwBase(AutotoolsPackage):
)
variant("openmp", default=False, description="Enable OpenMP support.")
variant("mpi", default=True, description="Activate MPI support")
variant("shared", default=True, description="Build shared libraries")
depends_on("mpi", when="+mpi")
depends_on("llvm-openmp", when="%apple-clang +openmp")
@ -104,7 +105,9 @@ def setup_build_environment(self, env):
def configure(self, spec, prefix):
# Base options
options = ["--prefix={0}".format(prefix), "--enable-shared", "--enable-threads"]
options = ["--prefix={0}".format(prefix), "--enable-threads"]
options.extend(self.enable_or_disable("shared"))
if not self.compiler.f77 or not self.compiler.fc:
options.append("--disable-fortran")
if spec.satisfies("@:2"):