diff options
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/package.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index f110700efb..e188bb94b1 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -188,11 +188,12 @@ class Hdf5(CMakePackage): cmake_flags = [] if name == "cflags": - cc_name = os.path.basename(self.compiler.cc) - if "clang" in cc_name or "gcc" in cc_name: + if self.spec.satisfies('%gcc') \ + or self.spec.satisfies('%clang'): # Quiet warnings/errors about implicit declaration of functions # in C99: cmake_flags.append("-Wno-implicit-function-declaration") + # Note that this flag will cause an error if building %nvhpc. if self.spec.satisfies('@:1.8.12~shared'): # More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to # True and build with PIC flags. |