From c8121338da8fd9078693bb53e93c04151ca5e27a Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Thu, 13 Jun 2024 22:14:03 -0700 Subject: [PATCH] Fix cc wrapper --- lib/spack/env/cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 9679cbfd5f4337..d9a10f2a515ac2 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -243,9 +243,11 @@ case "$command" in # Edge case for Intel's oneAPI compilers when using the legacy classic compilers: # Pass flags to disable deprecation warnings to vcheck mode, since the warnings # to stderr confuse tools that parse the output of compiler version checks. - if [[ ${SPACK_CFLAGS} == *"-diag-disable=10441"* ]]; then - vcheck_flags="-diag-disable=10441" - fi + case ${SPACK_CXXFLAGS} in + *"-diag-disable=10441"* ) + vcheck_flags="-diag-disable=10441" + ;; + esac command="$SPACK_CC" language="C" comp="CC" @@ -256,9 +258,11 @@ case "$command" in # Edge case for Intel's oneAPI compilers when using the legacy classic compilers: # Pass flags to disable deprecation warnings to vcheck mode, since the warnings # to stderr confuse tools that parse the output of compiler version checks. - if [[ ${SPACK_CXXFLAGS} == *"-diag-disable=10441"* ]]; then - vcheck_flags="-diag-disable=10441" - fi + case ${SPACK_CXXFLAGS} in + *"-diag-disable=10441"* ) + vcheck_flags="-diag-disable=10441" + ;; + esac command="$SPACK_CXX" language="C++" comp="CXX" @@ -269,9 +273,11 @@ case "$command" in # Edge case for Intel's oneAPI compilers when using the legacy classic compilers: # Pass flags to disable deprecation warnings to vcheck mode, since the warnings # to stderr confuse tools that parse the output of compiler version checks. - if [[ ${SPACK_FFLAGS} == *"-diag-disable=10448"* ]]; then - vcheck_flags="-diag-disable=10448" - fi + case ${SPACK_CXXFLAGS} in + *"-diag-disable=10441"* ) + vcheck_flags="-diag-disable=10441" + ;; + esac command="$SPACK_FC" language="Fortran 90" comp="FC"