Get Clang to report errors for unused vs. unknown linker flags
authorDavid Morsberger <dave@morsberger.com>
Thu, 28 Jan 2016 01:24:01 +0000 (20:24 -0500)
committerGuy Harris <guy@alum.mit.edu>
Thu, 28 Jan 2016 02:44:14 +0000 (02:44 +0000)
Change-Id: Iabe497d88239c1e15d7ef6d44c6fca79c8be2d1c
Reviewed-on: https://code.wireshark.org/review/13569
Reviewed-by: Guy Harris <guy@alum.mit.edu>
cmake/modules/CheckCLinkerFlag.cmake

index 9a9096b7e113ae7d5d8576d8590979f5a205c651..120471f1825591a65aee5abaf062863a36bb3da4 100644 (file)
@@ -44,10 +44,10 @@ MACRO (CHECK_C_LINKER_FLAG _FLAG _RESULT)
    elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
       #
       # We'll be running the linker through the compiler driver, so
    elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
       #
       # We'll be running the linker through the compiler driver, so
-      # we may need to pass -Werror=unknown-warning-option to have it
+      # we may need to pass -Werror=unused-command-line-argument to have it
       # fail, rather than just complaining and driving on, if it's
       # passed a flag it doesn't handle.
       # fail, rather than just complaining and driving on, if it's
       # passed a flag it doesn't handle.
-      set(CMAKE_REQUIRED_LIBRARIES "-Werror=unknown-warning-option")
+      set(CMAKE_REQUIRED_LIBRARIES "-Werror=unused-command-line-argument")
    endif()
    set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${_FLAG}")
    message(status "check linker flag - test linker flags: ${_FLAG}")
    endif()
    set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${_FLAG}")
    message(status "check linker flag - test linker flags: ${_FLAG}")