diff options
author | Brad King <brad.king@kitware.com> | 2015-05-26 13:23:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-05-26 13:23:54 (GMT) |
commit | 36386413969149fde706c04dec478a3de50c5a28 (patch) | |
tree | fafc61eaeaa7578a2d376ced817e3b486a6f4474 | |
parent | 4f0125a45b8643ff62c79c79eac7caf63c8fe7bd (diff) | |
parent | b3475ba57bc839125440fe8d21f611198041434e (diff) | |
download | CMake-36386413969149fde706c04dec478a3de50c5a28.zip CMake-36386413969149fde706c04dec478a3de50c5a28.tar.gz CMake-36386413969149fde706c04dec478a3de50c5a28.tar.bz2 |
Merge topic 'run-include-what-you-use'
b3475ba5 Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERS
6 files changed, 25 insertions, 7 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 0c8acc7..7b88bc7 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -761,13 +761,6 @@ cmMakefileTargetGenerator source.GetFullPath(), workingDirectory, compileCommand); } - // Expand placeholders in the commands. - for(std::vector<std::string>::iterator i = compileCommands.begin(); - i != compileCommands.end(); ++i) - { - this->LocalGenerator->ExpandRuleVariables(*i, vars); - } - // Maybe insert an include-what-you-use runner. if (!compileCommands.empty() && (lang == "C" || lang == "CXX")) { @@ -782,6 +775,13 @@ cmMakefileTargetGenerator } } + // Expand placeholders in the commands. + for(std::vector<std::string>::iterator i = compileCommands.begin(); + i != compileCommands.end(); ++i) + { + this->LocalGenerator->ExpandRuleVariables(*i, vars); + } + // Change the command working directory to the local build tree. this->LocalGenerator->CreateCDCommand (compileCommands, diff --git a/Tests/RunCMake/IncludeWhatYouUse/C-launch-Build-stdout.txt b/Tests/RunCMake/IncludeWhatYouUse/C-launch-Build-stdout.txt new file mode 100644 index 0000000..cb74677 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/C-launch-Build-stdout.txt @@ -0,0 +1,4 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> diff --git a/Tests/RunCMake/IncludeWhatYouUse/C-launch.cmake b/Tests/RunCMake/IncludeWhatYouUse/C-launch.cmake new file mode 100644 index 0000000..e66ca20 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/C-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(C.cmake) diff --git a/Tests/RunCMake/IncludeWhatYouUse/CXX-launch-Build-stdout.txt b/Tests/RunCMake/IncludeWhatYouUse/CXX-launch-Build-stdout.txt new file mode 100644 index 0000000..cb74677 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/CXX-launch-Build-stdout.txt @@ -0,0 +1,4 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> diff --git a/Tests/RunCMake/IncludeWhatYouUse/CXX-launch.cmake b/Tests/RunCMake/IncludeWhatYouUse/CXX-launch.cmake new file mode 100644 index 0000000..3002c9d --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/CXX-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(CXX.cmake) diff --git a/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake b/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake index 68c6bd7..8f99eb1 100644 --- a/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake +++ b/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake @@ -16,3 +16,7 @@ endfunction() run_iwyu(C) run_iwyu(CXX) +if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") + run_iwyu(C-launch) + run_iwyu(CXX-launch) +endif() |