diff --git a/config/unix-clang.cmake b/config/unix-clang.cmake index 704de0ddc..bd01a9723 100644 --- a/config/unix-clang.cmake +++ b/config/unix-clang.cmake @@ -62,7 +62,8 @@ if(NOT CXX_FLAGS_INITIALIZED) # OneAPI on trinitite reports itself as "LLVM" and parses this file. The Intel optimizer needs # these options to maintain IEEE 754 compliance. - if(CMAKE_CXX_COMPILER_WRAPPER STREQUAL CrayPrgEnv AND INTEL_COMPILER_TYPE STREQUAL "ONEAPI") + if(DEFINED CMAKE_CXX_COMPILER_WRAPPER AND CMAKE_CXX_COMPILER_WRAPPER STREQUAL CrayPrgEnv AND + DEFINED ENV{INTEL_COMPILER_TYPE} AND "$ENV{INTEL_COMPILER_TYPE}" STREQUAL "ONEAPI") string(APPEND CMAKE_C_FLAGS_RELEASE " -fp-model=precise") string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " -fp-model=precise") endif()