diff options
author | Bram Metsch <bram.metsch@scai.fraunhofer.de> | 2023-09-07 16:07:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-07 19:15:08 (GMT) |
commit | e30f0f89afcfb748d464fbe84e0566a36f2bee87 (patch) | |
tree | 5dcf5996b554fccdc7432c93d02e7f57fdba1d3f | |
parent | 4b28f3959155698115bb817889993492706da740 (diff) | |
download | CMake-e30f0f89afcfb748d464fbe84e0566a36f2bee87.zip CMake-e30f0f89afcfb748d464fbe84e0566a36f2bee87.tar.gz CMake-e30f0f89afcfb748d464fbe84e0566a36f2bee87.tar.bz2 |
IntelLLVM: Suppress -Rdebug-disables-optimization on debug builds
IntelLLVM 2023.0.0 and above emit this remark if `-g` is used without
any `-O<level>` flag, which is our default behavior. Add another flag
to suppress the remark.
-rw-r--r-- | Modules/Compiler/IntelLLVM.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake index e256c8f..f3c0bf4 100644 --- a/Modules/Compiler/IntelLLVM.cmake +++ b/Modules/Compiler/IntelLLVM.cmake @@ -44,6 +44,13 @@ else() string(APPEND CMAKE_${lang}_FLAGS_INIT " ") string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2023.0.0) + if("x${lang}" STREQUAL "xFortran") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -diag-disable:10440") + else() + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -Rno-debug-disables-optimization") + endif() + endif() string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os") string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") |