summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-17 15:06:44 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-17 15:06:44 (GMT)
commite4cb7d76095c429690255620a101b1a6f66f65df (patch)
treef65370811868c80fa3209bc76fff540182d1f19b /Tests/RunCMake/CMakeLists.txt
parent5889eb43eaad2e377cee36f813872ddb381b2e43 (diff)
parenta0902efaa747d567fdd35729c8f0dac7b4fbee6d (diff)
downloadCMake-e4cb7d76095c429690255620a101b1a6f66f65df.zip
CMake-e4cb7d76095c429690255620a101b1a6f66f65df.tar.gz
CMake-e4cb7d76095c429690255620a101b1a6f66f65df.tar.bz2
Merge topic 'link_what_you_use'
a0902efa Help: Add notes for topic 'link_what_you_use' 96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
Diffstat (limited to 'Tests/RunCMake/CMakeLists.txt')
-rw-r--r--Tests/RunCMake/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d16e5e7..b6d1c38 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -307,6 +307,14 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]"
endif()
if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ if(UNIX AND NOT CYGWIN)
+ execute_process(COMMAND ldd --help
+ OUTPUT_VARIABLE LDD_HELP)
+ if("${LDD_HELP}" MATCHES
+ "(-r, --function-relocs.*process data and function relocations.*-u, --unused.*print unused direct dependencies)")
+ add_RunCMake_test(LinkWhatYouUse)
+ endif()
+ endif()
add_executable(pseudo_tidy pseudo_tidy.c)
add_executable(pseudo_iwyu pseudo_iwyu.c)
add_RunCMake_test(ClangTidy -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>)