diff options
author | Brad King <brad.king@kitware.com> | 2019-05-15 13:21:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-15 13:22:18 (GMT) |
commit | 66efdbd21a46b63572f5de677ed126a68e524e7a (patch) | |
tree | ca828de9a043ff83bd321185b1c23de9a6b2a788 /Source/cmLocalNinjaGenerator.cxx | |
parent | 0064edf4173fad72749da2c66753387e9a671223 (diff) | |
parent | b5bf369ec68a60bf71297e941bcc742904aae148 (diff) | |
download | CMake-66efdbd21a46b63572f5de677ed126a68e524e7a.zip CMake-66efdbd21a46b63572f5de677ed126a68e524e7a.tar.gz CMake-66efdbd21a46b63572f5de677ed126a68e524e7a.tar.bz2 |
Merge topic 'additional_clean_files'
b5bf369ec6 Release notes: Add release notes for ADDITIONAL_CLEAN_FILES properties
4e2ce0a67a Doc: Update and deprecate ADDITIONAL_MAKE_CLEAN_FILES directory property
338994d65d Doc: Add documentation for ADDITIONAL_CLEAN_FILES properties
c11f089d73 Tests: Extend MakeClean test to cover ADDITIONAL_CLEAN_FILES
012d599e26 Ninja: Add support for ADDITIONAL_CLEAN_FILES target property
890a1b9dc3 Ninja: Add support for ADDITIONAL_CLEAN_FILES directory property
7b23001f20 Ninja: Add support for additional clean files
d745df4b01 Makefiles: Add support for ADDITIONAL_CLEAN_FILES target property
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3318
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 869d25d..7f7ee71 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -14,6 +14,7 @@ #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmGlobalNinjaGenerator.h" @@ -94,6 +95,7 @@ void cmLocalNinjaGenerator::Generate() } this->WriteCustomCommandBuildStatements(); + this->AdditionalCleanFiles(); } // TODO: Picked up from cmLocalUnixMakefileGenerator3. Refactor it. @@ -598,3 +600,26 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( return launcher; } + +void cmLocalNinjaGenerator::AdditionalCleanFiles() +{ + if (const char* prop_value = + this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) { + std::vector<std::string> cleanFiles; + { + cmGeneratorExpression ge; + auto cge = ge.Parse(prop_value); + cmSystemTools::ExpandListArgument( + cge->Evaluate(this, + this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")), + cleanFiles); + } + std::string const& binaryDir = this->GetCurrentBinaryDirectory(); + cmGlobalNinjaGenerator* gg = this->GetGlobalNinjaGenerator(); + for (std::string const& cleanFile : cleanFiles) { + // Support relative paths + gg->AddAdditionalCleanFile( + cmSystemTools::CollapseFullPath(cleanFile, binaryDir)); + } + } +} |