[Cmake-commits] CMake branch, next, updated. v3.6.0-rc2-370-g541633c

Brad King brad.king at kitware.com
Fri Jun 17 10:55:39 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  541633c9ddc26fc44454b3b7eea74ec19115b81b (commit)
       via  10d5ba9d3dc0a9dceb30eaac6d672c5a5f94ac5b (commit)
      from  a094bf658b0ee0d2a35e09a8fd7dfaad8442adca (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=541633c9ddc26fc44454b3b7eea74ec19115b81b
commit 541633c9ddc26fc44454b3b7eea74ec19115b81b
Merge: a094bf6 10d5ba9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 17 10:55:38 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 17 10:55:38 2016 -0400

    Merge topic 'link_what_you_use' into next
    
    10d5ba9d fixup! Add support for ldd -u -r as link what you use tool.


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10d5ba9d3dc0a9dceb30eaac6d672c5a5f94ac5b
commit 10d5ba9d3dc0a9dceb30eaac6d672c5a5f94ac5b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 17 10:46:03 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 17 10:46:03 2016 -0400

    fixup! Add support for ldd -u -r as link what you use tool.

diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 9c34125..ba4c6e6 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -187,9 +187,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     this->LocalGenerator->AppendFlags(
       linkFlags, this->Makefile->GetDefinition(export_flag_var));
   }
-  if(this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
-    this->LocalGenerator->AppendFlags(linkFlags,
-                                      " -Wl,--no-as-needed");
+  if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+    this->LocalGenerator->AppendFlags(linkFlags, " -Wl,--no-as-needed");
   }
 
   // Add language feature flags.
@@ -360,11 +359,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     vars.LinkFlags = linkFlags.c_str();
     vars.Manifests = manifests.c_str();
 
-    if(this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+    if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
       std::string cmakeCommand =
-        this->Convert(
-          cmSystemTools::GetCMakeCommand(), cmLocalGenerator::NONE,
-          cmLocalGenerator::SHELL);
+        this->Convert(cmSystemTools::GetCMakeCommand(), cmLocalGenerator::NONE,
+                      cmLocalGenerator::SHELL);
       cmakeCommand += " -E __run_iwyu --lwyu=";
       cmakeCommand += targetOutPathReal;
       real_link_commands.push_back(cmakeCommand);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2429016..6666c36 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -163,9 +163,8 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
     extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
   this->AddModuleDefinitionFlag(extraFlags);
 
-  if(this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
-    this->LocalGenerator->AppendFlags(extraFlags,
-                                      " -Wl,--no-as-needed");
+  if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+    this->LocalGenerator->AppendFlags(extraFlags, " -Wl,--no-as-needed");
   }
   this->WriteLibraryRules(linkRuleVar, extraFlags, relink);
 }
@@ -686,12 +685,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
       // Get the set of commands.
       std::string linkRule = this->GetLinkRule(linkRuleVar);
       cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
-      if(this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") &&
-         (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) {
+      if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") &&
+          (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) {
         std::string cmakeCommand =
-          this->Convert(
-            cmSystemTools::GetCMakeCommand(), cmLocalGenerator::NONE,
-            cmLocalGenerator::SHELL);
+          this->Convert(cmSystemTools::GetCMakeCommand(),
+                        cmLocalGenerator::NONE, cmLocalGenerator::SHELL);
         cmakeCommand += " -E __run_iwyu --lwyu=";
         cmakeCommand += targetOutPathReal;
         real_link_commands.push_back(cmakeCommand);
@@ -725,7 +723,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
   commands.insert(commands.end(), commands1.begin(), commands1.end());
   commands1.clear();
 
-
   // Add a rule to create necessary symlinks for the library.
   // Frameworks are handled by cmOSXBundleGenerator.
   if (targetOutPath != targetOutPathReal &&
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index d0e48d5..7c18414 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -295,7 +295,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
     const char* linkCmd = mf->GetDefinition(linkCmdVar);
     if (linkCmd) {
       cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
-      if( this->GetGeneratorTarget()->GetProperty("LINK_WHAT_YOU_USE")) {
+      if (this->GetGeneratorTarget()->GetProperty("LINK_WHAT_YOU_USE")) {
         std::string cmakeCommand =
           this->GetLocalGenerator()->ConvertToOutputFormat(
             cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
@@ -305,8 +305,8 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
         std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
         std::string targetOutputReal =
           this->ConvertToNinjaPath(gt.GetFullPath(cfgName,
-                                            /*implib=*/false,
-                                            /*realpath=*/true));
+                                                  /*implib=*/false,
+                                                  /*realpath=*/true));
         cmakeCommand += targetOutputReal;
         cmakeCommand += " || true";
         linkCmds.push_back(cmakeCommand);
@@ -484,7 +484,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
 
   vars["LINK_PATH"] = frameworkPath + linkPath;
   std::string lwyuFlags;
-  if(genTarget.GetProperty("LINK_WHAT_YOU_USE")) {
+  if (genTarget.GetProperty("LINK_WHAT_YOU_USE")) {
     lwyuFlags = " -Wl,--no-as-needed";
   }
 
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index e5b8491..161256e 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -372,12 +372,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
         // Output the stdout from ldd -r -u to stderr
         // Warn if lwyu reported anything.
         if (stdOut.find("Unused direct dependencies:") != stdOut.npos) {
-          std::cerr <<  "Warning: " << stdOut;
+          std::cerr << "Warning: " << stdOut;
         }
       }
       ret = 0;
       // Now run the real compiler command and return its result value.
-      if (lwyu.empty() && !cmSystemTools::RunSingleCommand(
+      if (lwyu.empty() &&
+          !cmSystemTools::RunSingleCommand(
             orig_cmd, 0, 0, &ret, 0, cmSystemTools::OUTPUT_PASSTHROUGH)) {
         std::cerr << "Error running '" << orig_cmd[0] << "'\n";
         return 1;

-----------------------------------------------------------------------

Summary of changes:
 Source/cmMakefileExecutableTargetGenerator.cxx |   12 +++++-------
 Source/cmMakefileLibraryTargetGenerator.cxx    |   15 ++++++---------
 Source/cmNinjaNormalTargetGenerator.cxx        |    8 ++++----
 Source/cmcmd.cxx                               |    5 +++--
 4 files changed, 18 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list