diff options
author | Michael Hirsch <scivision@users.noreply.gitlab.kitware.com> | 2022-10-06 19:11:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-07 14:05:49 (GMT) |
commit | 13f3382b1c11318d6f1f7ad6756a5a353e76d2b3 (patch) | |
tree | 7e48fd1bc97c42c6971d16420ffcc0959dd253f6 /Modules/Compiler/Intel.cmake | |
parent | ab8a0a106ebeb2dd5592692c60512e7234ccfad2 (diff) | |
download | CMake-13f3382b1c11318d6f1f7ad6756a5a353e76d2b3.zip CMake-13f3382b1c11318d6f1f7ad6756a5a353e76d2b3.tar.gz CMake-13f3382b1c11318d6f1f7ad6756a5a353e76d2b3.tar.bz2 |
Intel/IntelLLVM: Fortran has distinct "-Werror"-like flag
Update the compiler options table added by commit 76a08cd253
(COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors,
2022-04-21, v3.24.0-rc1~173^2) to use the Intel Fortran compilers'
dedicated `-warn*` flags.
Diffstat (limited to 'Modules/Compiler/Intel.cmake')
-rw-r--r-- | Modules/Compiler/Intel.cmake | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake index 20989d2..642e58a 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -13,7 +13,11 @@ include(Compiler/CMakeCommonCompilerMacros) if(CMAKE_HOST_WIN32) # MSVC-like macro(__compiler_intel lang) - set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all") + if("x${lang}" STREQUAL "xFortran") + set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn:errors") + else() + set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all") + endif() endmacro() else() # GNU-like @@ -25,7 +29,6 @@ else() 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") - set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all") set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}") if(CMAKE_${lang}_COMPILER_ARG1) @@ -35,7 +38,9 @@ else() endif() list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") - if(NOT "x${lang}" STREQUAL "xFortran") + if("x${lang}" STREQUAL "xFortran") + set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn" "errors") + else() # Precompile Headers set(CMAKE_PCH_EXTENSION .pchi) set(CMAKE_LINK_PCH ON) @@ -43,6 +48,9 @@ else() set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch) set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>) set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>) + + # COMPILE_WARNING_AS_ERROR + set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all") endif() endmacro() endif() |