diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-07-02 08:47:32 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-07-09 12:50:50 (GMT) |
commit | 14e57e9637964594461711954c6c906bc22eb7c7 (patch) | |
tree | 7e6bbfb2303d1c4377470180a36a6103df1a55fb /Source/cmcmd.cxx | |
parent | 9c5132a586562c00511fd8ff2bac0250c70dae95 (diff) | |
download | CMake-14e57e9637964594461711954c6c906bc22eb7c7.zip CMake-14e57e9637964594461711954c6c906bc22eb7c7.tar.gz CMake-14e57e9637964594461711954c6c906bc22eb7c7.tar.bz2 |
LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.
Fixes: #20174
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 1f4c0b8..1e0f497 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -385,18 +385,15 @@ int HandleTidy(const std::string& runCmd, const std::string& sourceFile, return ret; } -int HandleLWYU(const std::string& runCmd, const std::string& /* sourceFile */, +int HandleLWYU(const std::string& runCmd, const std::string& sourceFile, const std::vector<std::string>&) { // Construct the ldd -r -u (link what you use lwyu) command line // ldd -u -r lwuy target - std::vector<std::string> lwyu_cmd; - lwyu_cmd.emplace_back("ldd"); - lwyu_cmd.emplace_back("-u"); - lwyu_cmd.emplace_back("-r"); - lwyu_cmd.push_back(runCmd); + std::vector<std::string> lwyu_cmd = cmExpandedList(runCmd, true); + lwyu_cmd.push_back(sourceFile); - // Run the ldd -u -r command line. + // Run the lwyu check command line, currently ldd is expected. // Capture its stdout and hide its stderr. // Ignore its return code because the tool always returns non-zero // if there are any warnings, but we just want to warn. |