[Cmake-commits] CMake branch, master, updated. v3.15.3-1188-g76ae4c5

Kitware Robot kwrobot at kitware.com
Wed Sep 25 12:40:54 EDT 2019


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, master has been updated
       via  76ae4c58394c5ec67916f5031e1fe7afca085cfb (commit)
       via  0578239d3a62ffb01a9b8cdb58f704b29725a1ee (commit)
      from  a6b379181495794d47cae256dfd94f43fbfe5d48 (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=76ae4c58394c5ec67916f5031e1fe7afca085cfb
commit 76ae4c58394c5ec67916f5031e1fe7afca085cfb
Merge: a6b3791 0578239
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 25 16:38:58 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Sep 25 12:39:14 2019 -0400

    Merge topic 'vs-16.4-custom-commands'
    
    0578239d3a VS: Tell VS 16.4 not to verify SYMBOLIC custom command outputs
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3860


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0578239d3a62ffb01a9b8cdb58f704b29725a1ee
commit 0578239d3a62ffb01a9b8cdb58f704b29725a1ee
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 23 15:30:15 2019 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 24 10:41:20 2019 -0400

    VS: Tell VS 16.4 not to verify SYMBOLIC custom command outputs
    
    VS 16.4 introduces an additional check on `CustomBuild` rules that warns
    if the outputs of the command are not created.  However, CMake supports
    marking outputs with the `SYMBOLIC` property to indicate that they will
    not actually be generated.  That property is used by Makefile and Ninja
    generators but has not been needed by the VS generators before.  Teach
    the VS generator to disable `VerifyInputsAndOutputsExist` in custom
    build rules that have a symbolic output.
    
    Fixes: #19737

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7d25713..7a90176 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1438,6 +1438,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
     }
     // output files for custom command
     std::stringstream outputs;
+    bool symbolic = false;
     {
       const char* sep = "";
       for (std::string const& o : ccg.GetOutputs()) {
@@ -1445,6 +1446,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
         ConvertToWindowsSlash(out);
         outputs << sep << out;
         sep = ";";
+        if (!symbolic) {
+          if (cmSourceFile* sf = this->Makefile->GetSource(
+                o, cmSourceFileLocationKind::Known)) {
+            symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+          }
+        }
       }
     }
     if (this->ProjectType == csproj) {
@@ -1454,7 +1461,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
                                   outputs.str(), comment);
     } else {
       this->WriteCustomRuleCpp(*spe2, c, script, additional_inputs.str(),
-                               outputs.str(), comment);
+                               outputs.str(), comment, symbolic);
     }
   }
 }
@@ -1462,7 +1469,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
 void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
   Elem& e2, std::string const& config, std::string const& script,
   std::string const& additional_inputs, std::string const& outputs,
-  std::string const& comment)
+  std::string const& comment, bool symbolic)
 {
   const std::string cond = this->CalcCondition(config);
   e2.WritePlatformConfigTag("Message", cond, comment);
@@ -1474,6 +1481,13 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
     // VS >= 11 let us turn off linking of custom command outputs.
     e2.WritePlatformConfigTag("LinkObjects", cond, "false");
   }
+  if (symbolic &&
+      this->LocalGenerator->GetVersion() >=
+        cmGlobalVisualStudioGenerator::VS16) {
+    // VS >= 16.4 warn if outputs are not created, but one of our
+    // outputs is marked SYMBOLIC and not expected to be created.
+    e2.WritePlatformConfigTag("VerifyInputsAndOutputsExist", cond, "false");
+  }
 }
 
 void cmVisualStudio10TargetGenerator::WriteCustomRuleCSharp(
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6607e77..d453d1a 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -142,7 +142,7 @@ private:
                           std::string const& script,
                           std::string const& additional_inputs,
                           std::string const& outputs,
-                          std::string const& comment);
+                          std::string const& comment, bool symbolic);
   void WriteCustomRuleCSharp(Elem& e0, std::string const& config,
                              std::string const& commandName,
                              std::string const& script,

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

Summary of changes:
 Source/cmVisualStudio10TargetGenerator.cxx | 18 ++++++++++++++++--
 Source/cmVisualStudio10TargetGenerator.h   |  2 +-
 2 files changed, 17 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list