فهرست منبع

CheckCompilerFlag: Improve layout of message regex tables

Brad King 4 ماه پیش
والد
کامیت
c196e024bd
2فایلهای تغییر یافته به همراه52 افزوده شده و 38 حذف شده
  1. 25 25
      Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
  2. 27 13
      Modules/Internal/CheckFlagCommonConfig.cmake

+ 25 - 25
Modules/CMakeCheckCompilerFlagCommonPatterns.cmake

@@ -8,34 +8,34 @@
 
 macro (CHECK_COMPILER_FLAG_COMMON_PATTERNS _VAR)
   set(${_VAR}
-    FAIL_REGEX "[Uu]nrecogni[sz]ed .*option"               # GNU, NAG, Fujitsu
-    FAIL_REGEX "switch .* is no longer supported"          # GNU
-    FAIL_REGEX "unknown .*option"                          # Clang
-    FAIL_REGEX "optimization flag .* not supported"        # Clang
-    FAIL_REGEX "unknown argument ignored"                  # Clang (cl)
-    FAIL_REGEX "ignoring unknown option"                   # MSVC, Intel
-    FAIL_REGEX "warning D9002"                             # MSVC, any lang
-    FAIL_REGEX "option.*not supported"                     # Intel
-    FAIL_REGEX "invalid argument .*option"                 # Intel
-    FAIL_REGEX "ignoring option .*argument required"       # Intel
-    FAIL_REGEX "ignoring option .*argument is of wrong type" # Intel
+    FAIL_REGEX "[Uu]nrecogni[sz]ed .*option"                                 # GNU, NAG, Fujitsu
+    FAIL_REGEX "switch .* is no longer supported"                            # GNU
+    FAIL_REGEX "unknown .*option"                                            # Clang
+    FAIL_REGEX "optimization flag .* not supported"                          # Clang
+    FAIL_REGEX "unknown argument ignored"                                    # Clang (cl)
+    FAIL_REGEX "ignoring unknown option"                                     # MSVC, Intel
+    FAIL_REGEX "warning D9002"                                               # MSVC, any lang
+    FAIL_REGEX "option.*not supported"                                       # Intel
+    FAIL_REGEX "invalid argument .*option"                                   # Intel
+    FAIL_REGEX "ignoring option .*argument required"                         # Intel
+    FAIL_REGEX "ignoring option .*argument is of wrong type"                 # Intel
     # noqa: spellcheck off
-    FAIL_REGEX "[Uu]nknown option"                         # HP
+    FAIL_REGEX "[Uu]nknown option"                                           # HP
     # noqa: spellcheck on
-    FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
-    FAIL_REGEX "command option .* is not recognized"       # XL
-    FAIL_REGEX "command option .* contains an incorrect subargument" # XL
-    FAIL_REGEX "Option .* is not recognized.  Option will be ignored." # XL
-    FAIL_REGEX "not supported in this configuration. ignored"       # AIX
-    FAIL_REGEX "File with unknown suffix passed to linker" # PGI
+    FAIL_REGEX "[Ww]arning: [Oo]ption"                                       # SunPro
+    FAIL_REGEX "command option .* is not recognized"                         # XL
+    FAIL_REGEX "command option .* contains an incorrect subargument"         # XL
+    FAIL_REGEX "Option .* is not recognized.  Option will be ignored."       # XL
+    FAIL_REGEX "not supported in this configuration. ignored"                # AIX
+    FAIL_REGEX "File with unknown suffix passed to linker"                   # PGI
     # noqa: spellcheck off
-    FAIL_REGEX "[Uu]nknown switch"                         # PGI
+    FAIL_REGEX "[Uu]nknown switch"                                           # PGI
     # noqa: spellcheck on
-    FAIL_REGEX "WARNING: unknown flag:"                    # Open64
-    FAIL_REGEX "Incorrect command line option:"            # Borland
-    FAIL_REGEX "Warning: illegal option"                   # SunStudio 12
-    FAIL_REGEX "[Ww]arning: Invalid suboption"             # Fujitsu
-    FAIL_REGEX "An invalid option .* appears on the command line" # Cray
-    FAIL_REGEX "WARNING: invalid compiler option"          # TI armcl
+    FAIL_REGEX "WARNING: unknown flag:"                                      # Open64
+    FAIL_REGEX "Incorrect command line option:"                              # Borland
+    FAIL_REGEX "Warning: illegal option"                                     # SunStudio 12
+    FAIL_REGEX "[Ww]arning: Invalid suboption"                               # Fujitsu
+    FAIL_REGEX "An invalid option .* appears on the command line"            # Cray
+    FAIL_REGEX "WARNING: invalid compiler option"                            # TI armcl
   )
 endmacro ()

+ 27 - 13
Modules/Internal/CheckFlagCommonConfig.cmake

@@ -11,39 +11,53 @@ include_guard(GLOBAL)
 macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
   if("${_LANG}" STREQUAL "C")
     set(${_SRC} "int main(void) { return 0; }")
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C"
-      FAIL_REGEX "-Werror=.* argument .* is not valid for C")
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for C"
+      FAIL_REGEX "-Werror=.* argument .* is not valid for C"
+    )
   elseif("${_LANG}" STREQUAL "CXX")
     set(${_SRC} "int main() { return 0; }")
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+"
-      FAIL_REGEX "-Werror=.* argument .* is not valid for C\\+\\+")
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+"
+      FAIL_REGEX "-Werror=.* argument .* is not valid for C\\+\\+"
+    )
   elseif("${_LANG}" STREQUAL "CUDA")
     set(${_SRC} "__host__ int main() { return 0; }")
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
-      FAIL_REGEX "argument unused during compilation: .*") # Clang
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
+      FAIL_REGEX "argument unused during compilation: .*" # Clang
+    )
   elseif("${_LANG}" STREQUAL "Fortran")
     set(${_SRC} "       program test\n       stop\n       end program")
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran"
-      FAIL_REGEX "argument unused during compilation: .*") # LLVMFlang
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran"
+      FAIL_REGEX "argument unused during compilation: .*" # LLVMFlang
+    )
   elseif("${_LANG}" STREQUAL "HIP")
     set(${_SRC} "__host__ int main() { return 0; }")
-    set(${_PATTERNS} FAIL_REGEX "argument unused during compilation: .*") # Clang
+    set(${_PATTERNS}
+      FAIL_REGEX "argument unused during compilation: .*" # Clang
+    )
   elseif("${_LANG}" STREQUAL "OBJC")
     set(${_SRC} [=[
       #ifndef __OBJC__
       #  error "Not an Objective-C compiler"
       #endif
       int main(void) { return 0; }]=])
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
-      FAIL_REGEX "argument unused during compilation: .*") # Clang
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
+      FAIL_REGEX "argument unused during compilation: .*" # Clang
+    )
   elseif("${_LANG}" STREQUAL "OBJCXX")
     set(${_SRC} [=[
       #ifndef __OBJC__
       #  error "Not an Objective-C++ compiler"
       #endif
       int main(void) { return 0; }]=])
-    set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
-      FAIL_REGEX "argument unused during compilation: .*") # Clang
+    set(${_PATTERNS}
+      FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
+      FAIL_REGEX "argument unused during compilation: .*" # Clang
+    )
   elseif("${_LANG}" STREQUAL "ISPC")
     set(${_SRC} "float func(uniform int32, float a) { return a / 2.25; }")
   elseif("${_LANG}" STREQUAL "Swift")