summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-27 10:27:28 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-27 18:27:55 +0000
commit8049df7943f7f18562afca128724a193dd78464b (patch)
tree0ea877a2589d2b0f872429d98395606d2b2fe966 /cmake
parente57bb1919c80a2d1c245d539f6450b9b9defcb68 (diff)
downloadwireshark-8049df7943f7f18562afca128724a193dd78464b.tar.gz
Get Clang to report errors for unknown linker flags.
Change-Id: Id8e77b6b521acc1ba684823211d6c09d0e5c111c Reviewed-on: https://code.wireshark.org/review/13566 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/CheckCLinkerFlag.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/modules/CheckCLinkerFlag.cmake b/cmake/modules/CheckCLinkerFlag.cmake
index f657a9b884..9a9096b7e1 100644
--- a/cmake/modules/CheckCLinkerFlag.cmake
+++ b/cmake/modules/CheckCLinkerFlag.cmake
@@ -41,6 +41,13 @@ MACRO (CHECK_C_LINKER_FLAG _FLAG _RESULT)
# passed a flag it doesn't handle.
#
set(CMAKE_REQUIRED_LIBRARIES "/WX")
+ 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
+ # 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")
endif()
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${_FLAG}")
message(status "check linker flag - test linker flags: ${_FLAG}")