From e3b1be24a808fdb3dc0482a33fe423c0eb945a7b Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Mon, 2 Apr 2012 12:35:55 +0200 Subject: [PATCH] Ninja: Clean all symlink created for libraries. 'ninja -t clean' only cleans built output and dep files so all file created as a side effect and not mentioned in the 'build' statement would be omitted. --- Source/cmNinjaNormalTargetGenerator.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 6befb051c..4787cb31b 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -508,11 +508,20 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() emptyDeps, symlinkVars); } else { - symlinkVars["SONAME"] = this->GetTargetFilePath(this->TargetNameSO); + cmNinjaDeps outputs; + const std::string soName = this->GetTargetFilePath(this->TargetNameSO); + // If one link has to be created. + if (targetOutputReal == soName || targetOutput == soName) { + symlinkVars["SONAME"] = soName; + } else { + symlinkVars["SONAME"] = ""; + outputs.push_back(soName); + } + outputs.push_back(targetOutput); cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(), "Create library symlink " + targetOutput, "CMAKE_SYMLINK_LIBRARY", - cmNinjaDeps(1, targetOutput), + outputs, cmNinjaDeps(1, targetOutputReal), emptyDeps, emptyDeps,