|
|
@@ -12,31 +12,31 @@ 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"
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for C"
|
|
|
+ FAIL_REGEX "-Werror=[^\n]* argument [^\n]* 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\\+\\+"
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for C\\+\\+"
|
|
|
+ FAIL_REGEX "-Werror=[^\n]* argument [^\n]* 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
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for C\\+\\+" # Host GNU
|
|
|
+ FAIL_REGEX "argument unused during compilation: [^\n]*" # 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
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for Fortran"
|
|
|
+ FAIL_REGEX "argument unused during compilation: [^\n]*" # LLVMFlang
|
|
|
)
|
|
|
elseif("${_LANG}" STREQUAL "HIP")
|
|
|
set(${_SRC} "__host__ int main() { return 0; }")
|
|
|
set(${_PATTERNS}
|
|
|
- FAIL_REGEX "argument unused during compilation: .*" # Clang
|
|
|
+ FAIL_REGEX "argument unused during compilation: [^\n]*" # Clang
|
|
|
)
|
|
|
elseif("${_LANG}" STREQUAL "OBJC")
|
|
|
set(${_SRC} [=[
|
|
|
@@ -45,8 +45,8 @@ macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
|
|
|
#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
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for Objective-C" # GNU
|
|
|
+ FAIL_REGEX "argument unused during compilation: [^\n]*" # Clang
|
|
|
)
|
|
|
elseif("${_LANG}" STREQUAL "OBJCXX")
|
|
|
set(${_SRC} [=[
|
|
|
@@ -55,8 +55,8 @@ macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
|
|
|
#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
|
|
|
+ FAIL_REGEX "command[ -]line option [^\n]* is valid for [^\n]* but not for Objective-C\\+\\+" # GNU
|
|
|
+ FAIL_REGEX "argument unused during compilation: [^\n]*" # Clang
|
|
|
)
|
|
|
elseif("${_LANG}" STREQUAL "ISPC")
|
|
|
set(${_SRC} "float func(uniform int32, float a) { return a / 2.25; }")
|