From 537a0a10e2b26a0feec0b8a6bc444144eb6ab4bd Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 23 Jul 2024 13:54:09 +0200 Subject: [PATCH] Clean up redundant settings in var/spack/repos/builtin/packages/hdf-eos2/package.py --- .../repos/builtin/packages/hdf-eos2/package.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/var/spack/repos/builtin/packages/hdf-eos2/package.py b/var/spack/repos/builtin/packages/hdf-eos2/package.py index e11e8ad69689b0..1b41abbf6509dc 100644 --- a/var/spack/repos/builtin/packages/hdf-eos2/package.py +++ b/var/spack/repos/builtin/packages/hdf-eos2/package.py @@ -120,8 +120,9 @@ def fix_configure(self): filter_file("CC=./\\$SZIP_CC", "", "configure") def flag_handler(self, name, flags): - if self.spec.compiler.name in ["apple-clang", "oneapi"]: - if name == "cflags": + if name == "cflags": + flags.append(self.compiler.cc_pic_flag) + if self.spec.compiler.name in ["apple-clang", "oneapi"]: flags.append("-Wno-error=implicit-function-declaration") flags.append("-Wno-error=implicit-int") @@ -161,15 +162,4 @@ def configure_args(self): if "zlib" in self.spec: extra_args.append("--with-zlib={0}".format(self.spec["zlib-api"].prefix)) - # https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680 - # -fPIC: https://github.com/spack/spack/issues/43792 - if self.spec.satisfies("%apple-clang"): - extra_args.append( - "CFLAGS=-Wno-error=implicit-function-declaration {0}".format( - self.compiler.cc_pic_flag - ) - ) - else: - extra_args.append("CFLAGS={0}".format(self.compiler.cc_pic_flag)) - return extra_args