summaryrefslogtreecommitdiff
path: root/Modules/Internal
diff options
context:
space:
mode:
authorKOLANICH <kolan_n@mail.ru>2023-01-23 03:13:56 +0300
committerBrad King <brad.king@kitware.com>2023-01-24 17:17:36 -0500
commit5b45a3d0ce5e2e73cd07cb103dedd4dd0204f6d1 (patch)
tree2ea8e3bf1a3a9312886d128b83c8b1699582b719 /Modules/Internal
parent6d57bbdc7b9299e97edfb224734dd95145e0b23f (diff)
downloadcmake-5b45a3d0ce5e2e73cd07cb103dedd4dd0204f6d1.tar.gz
CheckCompilerFlag: Match the Clang "argument unused" output for all languages
Improve detection of missing compiler flags: move "argument unused during compilation: .*" pattern from language-specific branches into the common list.
Diffstat (limited to 'Modules/Internal')
-rw-r--r--Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake1
-rw-r--r--Modules/Internal/CheckFlagCommonConfig.cmake10
2 files changed, 3 insertions, 8 deletions
diff --git a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
index b671b4a01e..ff8908be13 100644
--- a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
+++ b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
@@ -69,7 +69,6 @@ function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result)
set (CCCF_COMMAND_PATTERN "<FLAG> -o <OUTPUT> <SOURCE>")
endif()
- list (APPEND CCCF_FAIL_REGEX "argument unused during compilation") # clang
if (check_lang STREQUAL "C")
list(APPEND CCCF_FAIL_REGEX
"command line option .* is valid for .* but not for C") # GNU
diff --git a/Modules/Internal/CheckFlagCommonConfig.cmake b/Modules/Internal/CheckFlagCommonConfig.cmake
index f8481cdd2b..61eada2ae8 100644
--- a/Modules/Internal/CheckFlagCommonConfig.cmake
+++ b/Modules/Internal/CheckFlagCommonConfig.cmake
@@ -22,30 +22,26 @@ macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
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
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")
elseif("${_LANG}" STREQUAL "HIP")
set(${_SRC} "__host__ int main() { return 0; }")
- 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
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
elseif("${_LANG}" STREQUAL "ISPC")
set(${_SRC} "float func(uniform int32, float a) { return a / 2.25; }")
elseif("${_LANG}" STREQUAL "Swift")