From f1fd1b4df52e66059f285ebd6202327cf6f7b815 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Tue, 28 Sep 2021 15:28:12 -0600 Subject: [PATCH] Fix bad logic that prevented -fp-model=precise from being used. (#1140) --- config/unix-clang.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()