[Cmake-commits] CMake branch, master, updated. v3.9.0-rc6-263-ge5c762d

Kitware Robot kwrobot at kitware.com
Thu Jul 13 07:45:27 EDT 2017


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  e5c762d32d8a1329aac66a66eaf634a009cb288b (commit)
       via  c8f4cf0821d86e705d255dcd03fa28e9558df83d (commit)
       via  0c5723821542a43fa211c73abc08e59e2fd395e2 (commit)
       via  2c82d9c81f869303d3202501665acd91311d7714 (commit)
       via  4db32275149e2a68c74d2abf5158ee29976b7300 (commit)
      from  3d209acc1fdb96a213fba0442af7c2719e4d2a36 (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=e5c762d32d8a1329aac66a66eaf634a009cb288b
commit e5c762d32d8a1329aac66a66eaf634a009cb288b
Merge: c8f4cf0 0c57238
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 13 11:42:56 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jul 13 07:44:11 2017 -0400

    Merge topic 'server-target-backtraces'
    
    0c572382 server: Report backtraces in codemodel response
    4db32275 server: Rename cmServerProtocol1_0 to cmServerProtocol1
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !992


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8f4cf0821d86e705d255dcd03fa28e9558df83d
commit c8f4cf0821d86e705d255dcd03fa28e9558df83d
Merge: 3d209ac 2c82d9c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 13 11:42:31 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jul 13 07:42:42 2017 -0400

    Merge topic 'source-group-regex-tweaks'
    
    2c82d9c8 Add more extensions to Resources source group by default
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1028


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c5723821542a43fa211c73abc08e59e2fd395e2
commit 0c5723821542a43fa211c73abc08e59e2fd395e2
Author:     Ivan Shcherbakov <ivan at sysprogs.com>
AuthorDate: Tue Jun 20 14:13:01 2017 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 11 07:50:22 2017 -0400

    server: Report backtraces in codemodel response
    
    Report the source locations (e.g. in `CMakeLists.txt`) for all targets
    and target-related statements.  This allows IDEs to locate the
    statements and automatically edit them when the user adds or removes
    files or changes target properties via GUI.
    
    Increment the protocol minor version number to tell clients that the new
    information is available.

diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index 9520cc1..211ebe4 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -496,6 +496,9 @@ Each target object can have the following keys:
   with the sysroot path.
 "fileGroups"
   contains the source files making up the target.
+"crossReferences"
+  contains the location of the target in the corresponding CMakeLists.txt
+  file and the locations of the related statements like "target_link_libraries"
 
 FileGroups are used to group sources using similar settings together.
 
@@ -521,6 +524,16 @@ Each fileGroup object may contain the following keys:
 All file paths in the fileGroup are either absolute or relative to the
 sourceDirectory of the target.
 
+CrossReferences object is used to report the location of the target (including
+the entire call stack if the target is defined in a function) and the related
+"target_link_libraries", "target_include_directories", "target_compile_definitions"
+and "target_compile_options" statements.
+
+See the example below for details on the internal format of the "crossReferences" object.
+Line numbers stated in the "backtrace" entries are 1-based. The last entry of a backtrace
+is a special entry with missing "line" and "name" fields that specifies the initial
+CMakeLists.txt file.
+
 Example::
 
   [== "CMake Server" ==[
@@ -557,7 +570,34 @@ CMake will reply::
                 "linkerLanguage": "C",
                 "name": "cmForm",
                 "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
-                "type": "STATIC_LIBRARY"
+                "type": "STATIC_LIBRARY",
+                "crossReferences": {
+                   "backtrace": [
+                      {
+                         "line": 7,
+                         "name": "add_executable",
+                         "path": "C:/full/path/CMakeLists.txt"
+                      },
+                      {
+                         "path": "c:/full/path/CMakeLists.txt"
+                      }
+                   ],
+                   "relatedStatements": [
+                      {
+                         "backtrace": [
+                            {
+                               "line": 8,
+                               "name": "target_link_libraries",
+                               "path": "c:/full/path/CMakeLists.txt"
+                            },
+                            {
+                               "path": "c:/full/path/CMakeLists.txt"
+                            }
+                         ],
+                         "type": "target_link_libraries"
+                      }
+                   ]
+                 }
               }
             ]
           },
diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h
index e6a7ae6..405ff6b 100644
--- a/Source/cmServerDictionary.h
+++ b/Source/cmServerDictionary.h
@@ -89,6 +89,11 @@ static const std::string kWARN_UNUSED_KEY = "warnUnused";
 static const std::string kWATCHED_DIRECTORIES_KEY = "watchedDirectories";
 static const std::string kWATCHED_FILES_KEY = "watchedFiles";
 
+static const std::string kTARGET_CROSS_REFERENCES_KEY = "crossReferences";
+static const std::string kLINE_NUMBER_KEY = "line";
+static const std::string kBACKTRACE_KEY = "backtrace";
+static const std::string kRELATED_STATEMENTS_KEY = "relatedStatements";
+
 static const std::string kSTART_MAGIC = "[== \"CMake Server\" ==[";
 static const std::string kEND_MAGIC = "]== \"CMake Server\" ==]";
 
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 54ee109..21b69cf 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -2,12 +2,14 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmServerProtocol.h"
 
+#include "cmAlgorithms.h"
 #include "cmExternalMakefileProjectGenerator.h"
 #include "cmFileMonitor.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalGenerator.h"
 #include "cmLinkLineComputer.h"
+#include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmServer.h"
@@ -18,6 +20,7 @@
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
 #include "cmSystemTools.h"
+#include "cmTarget.h"
 #include "cm_uv.h"
 #include "cmake.h"
 
@@ -249,7 +252,7 @@ bool cmServerProtocol::DoActivate(const cmServerRequest& /*request*/,
 
 std::pair<int, int> cmServerProtocol1::ProtocolVersion() const
 {
-  return std::make_pair(1, 0);
+  return std::make_pair(1, 1);
 }
 
 static void setErrorMessage(std::string* errorMessage, const std::string& text)
@@ -729,6 +732,37 @@ static Json::Value DumpSourceFilesList(
   return result;
 }
 
+static Json::Value DumpBacktrace(const cmListFileBacktrace& backtrace)
+{
+  Json::Value result = Json::arrayValue;
+
+  cmListFileBacktrace backtraceCopy = backtrace;
+  while (!backtraceCopy.Top().FilePath.empty()) {
+    Json::Value entry = Json::objectValue;
+    entry[kPATH_KEY] = backtraceCopy.Top().FilePath;
+    if (backtraceCopy.Top().Line) {
+      entry[kLINE_NUMBER_KEY] = (int)backtraceCopy.Top().Line;
+    }
+    if (!backtraceCopy.Top().Name.empty()) {
+      entry[kNAME_KEY] = backtraceCopy.Top().Name;
+    }
+    result.append(std::move(entry));
+    backtraceCopy = backtraceCopy.Pop();
+  }
+  return result;
+}
+
+static void DumpBacktraceRange(Json::Value& result, const std::string& type,
+                               const cmBacktraceRange& range)
+{
+  for (const auto& bt : range) {
+    Json::Value obj = Json::objectValue;
+    obj[kTYPE_KEY] = type;
+    obj[kBACKTRACE_KEY] = DumpBacktrace(bt);
+    result.append(obj);
+  }
+}
+
 static Json::Value DumpTarget(cmGeneratorTarget* target,
                               const std::string& config)
 {
@@ -763,6 +797,22 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
 
   result[kFULL_NAME_KEY] = target->GetFullName(config);
 
+  Json::Value crossRefs = Json::objectValue;
+  crossRefs[kBACKTRACE_KEY] = DumpBacktrace(target->Target->GetBacktrace());
+
+  Json::Value statements = Json::arrayValue;
+  DumpBacktraceRange(statements, "target_compile_definitions",
+                     target->Target->GetCompileDefinitionsBacktraces());
+  DumpBacktraceRange(statements, "target_include_directories",
+                     target->Target->GetIncludeDirectoriesBacktraces());
+  DumpBacktraceRange(statements, "target_compile_options",
+                     target->Target->GetCompileOptionsBacktraces());
+  DumpBacktraceRange(statements, "target_link_libraries",
+                     target->Target->GetLinkImplementationBacktraces());
+
+  crossRefs[kRELATED_STATEMENTS_KEY] = std::move(statements);
+  result[kTARGET_CROSS_REFERENCES_KEY] = std::move(crossRefs);
+
   if (target->HaveWellDefinedOutputFiles()) {
     Json::Value artifacts = Json::arrayValue;
     artifacts.append(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c82d9c81f869303d3202501665acd91311d7714
commit 2c82d9c81f869303d3202501665acd91311d7714
Author:     UfoXp <ufoxp at me.me>
AuthorDate: Wed Jul 5 18:36:30 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 10 11:33:56 2017 -0400

    Add more extensions to Resources source group by default
    
    Extend the Resources group regex to match pdf, png, jpeg, jpg,
    storyboards, and xcassets.  This cleans up more complex Xcode projects a
    lot.
    
    While at it, factor the regular expressions for both "Resources" and
    "Source Files" into macros.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4a0cab3..caf8993 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -87,12 +87,10 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   this->AddSourceGroup("", "^.*$");
-  this->AddSourceGroup("Source Files",
-                       "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
-                       "|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
+  this->AddSourceGroup("Source Files", CM_SOURCE_REGEX);
   this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
   this->AddSourceGroup("CMake Rules", "\\.rule$");
-  this->AddSourceGroup("Resources", "\\.plist$");
+  this->AddSourceGroup("Resources", CM_RESOURCE_REGEX);
   this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
 
   this->ObjectLibrariesSourceGroupIndex = this->SourceGroups.size();
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 0be659c..e739d18 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -120,4 +120,10 @@ private:
 // TODO: Factor out into platform information modules.
 #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"
 
+#define CM_SOURCE_REGEX                                                       \
+  "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj"  \
+  "|bat)$"
+
+#define CM_RESOURCE_REGEX "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets)$"
+
 #endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4db32275149e2a68c74d2abf5158ee29976b7300
commit 4db32275149e2a68c74d2abf5158ee29976b7300
Author:     Ivan Shcherbakov <ivan at sysprogs.com>
AuthorDate: Wed Jul 5 21:24:29 2017 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 6 11:03:14 2017 -0400

    server: Rename cmServerProtocol1_0 to cmServerProtocol1
    
    It will serve additional minor versions.
    
    Suggested-by: Tobias Hunger <tobias.hunger at qt.io>

diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 7fc6ed7..5283dfc 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -36,7 +36,7 @@ cmServer::cmServer(cmServerConnection* conn, bool supportExperimental)
 {
   this->Connection->SetServer(this);
   // Register supported protocols:
-  this->RegisterProtocol(new cmServerProtocol1_0);
+  this->RegisterProtocol(new cmServerProtocol1);
 }
 
 cmServer::~cmServer()
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index defba77..54ee109 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -247,7 +247,7 @@ bool cmServerProtocol::DoActivate(const cmServerRequest& /*request*/,
   return true;
 }
 
-std::pair<int, int> cmServerProtocol1_0::ProtocolVersion() const
+std::pair<int, int> cmServerProtocol1::ProtocolVersion() const
 {
   return std::make_pair(1, 0);
 }
@@ -297,8 +297,8 @@ static bool testValue(cmState* state, const std::string& key,
   return true;
 }
 
-bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
-                                     std::string* errorMessage)
+bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
+                                   std::string* errorMessage)
 {
   std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString();
   const std::string buildDirectory =
@@ -417,8 +417,8 @@ bool cmServerProtocol1_0::DoActivate(const cmServerRequest& request,
   return true;
 }
 
-void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path,
-                                                 int event, int status)
+void cmServerProtocol1::HandleCMakeFileChanges(const std::string& path,
+                                               int event, int status)
 {
   assert(status == 0);
   static_cast<void>(status);
@@ -441,7 +441,7 @@ void cmServerProtocol1_0::HandleCMakeFileChanges(const std::string& path,
   SendSignal(kFILE_CHANGE_SIGNAL, obj);
 }
 
-const cmServerResponse cmServerProtocol1_0::Process(
+const cmServerResponse cmServerProtocol1::Process(
   const cmServerRequest& request)
 {
   assert(this->m_State >= STATE_ACTIVE);
@@ -474,12 +474,12 @@ const cmServerResponse cmServerProtocol1_0::Process(
   return request.ReportError("Unknown command!");
 }
 
-bool cmServerProtocol1_0::IsExperimental() const
+bool cmServerProtocol1::IsExperimental() const
 {
   return true;
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessCache(
+cmServerResponse cmServerProtocol1::ProcessCache(
   const cmServerRequest& request)
 {
   if (this->m_State < STATE_CONFIGURED) {
@@ -528,7 +528,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCache(
   return request.Reply(result);
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessCMakeInputs(
+cmServerResponse cmServerProtocol1::ProcessCMakeInputs(
   const cmServerRequest& request)
 {
   if (this->m_State < STATE_CONFIGURED) {
@@ -915,7 +915,7 @@ static Json::Value DumpConfigurationsList(const cmake* cm)
   return result;
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessCodeModel(
+cmServerResponse cmServerProtocol1::ProcessCodeModel(
   const cmServerRequest& request)
 {
   if (this->m_State != STATE_COMPUTED) {
@@ -927,7 +927,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCodeModel(
   return request.Reply(result);
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessCompute(
+cmServerResponse cmServerProtocol1::ProcessCompute(
   const cmServerRequest& request)
 {
   if (this->m_State > STATE_CONFIGURED) {
@@ -947,7 +947,7 @@ cmServerResponse cmServerProtocol1_0::ProcessCompute(
   return request.Reply(Json::Value());
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessConfigure(
+cmServerResponse cmServerProtocol1::ProcessConfigure(
   const cmServerRequest& request)
 {
   if (this->m_State == STATE_INACTIVE) {
@@ -1053,7 +1053,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure(
   return request.Reply(Json::Value());
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessGlobalSettings(
+cmServerResponse cmServerProtocol1::ProcessGlobalSettings(
   const cmServerRequest& request)
 {
   cmake* cm = this->CMakeInstance();
@@ -1089,7 +1089,7 @@ static void setBool(const cmServerRequest& request, const std::string& key,
   setter(request.Data[key].asBool());
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings(
+cmServerResponse cmServerProtocol1::ProcessSetGlobalSettings(
   const cmServerRequest& request)
 {
   const std::vector<std::string> boolValues = {
@@ -1121,7 +1121,7 @@ cmServerResponse cmServerProtocol1_0::ProcessSetGlobalSettings(
   return request.Reply(Json::Value());
 }
 
-cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers(
+cmServerResponse cmServerProtocol1::ProcessFileSystemWatchers(
   const cmServerRequest& request)
 {
   const cmFileMonitor* const fm = FileMonitor();
@@ -1140,7 +1140,7 @@ cmServerResponse cmServerProtocol1_0::ProcessFileSystemWatchers(
   return request.Reply(result);
 }
 
-cmServerProtocol1_0::GeneratorInformation::GeneratorInformation(
+cmServerProtocol1::GeneratorInformation::GeneratorInformation(
   const std::string& generatorName, const std::string& extraGeneratorName,
   const std::string& toolset, const std::string& platform,
   const std::string& sourceDirectory, const std::string& buildDirectory)
@@ -1153,7 +1153,7 @@ cmServerProtocol1_0::GeneratorInformation::GeneratorInformation(
 {
 }
 
-void cmServerProtocol1_0::GeneratorInformation::SetupGenerator(
+void cmServerProtocol1::GeneratorInformation::SetupGenerator(
   cmake* cm, std::string* errorMessage)
 {
   const std::string fullGeneratorName =
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index 83b3d58..4e57bb6 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -98,7 +98,7 @@ private:
   friend class cmServer;
 };
 
-class cmServerProtocol1_0 : public cmServerProtocol
+class cmServerProtocol1 : public cmServerProtocol
 {
 public:
   std::pair<int, int> ProtocolVersion() const override;

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

Summary of changes:
 Help/manual/cmake-server.7.rst |   42 +++++++++++++++++++-
 Source/cmMakefile.cxx          |    6 +--
 Source/cmServer.cxx            |    2 +-
 Source/cmServerDictionary.h    |    5 +++
 Source/cmServerProtocol.cxx    |   86 +++++++++++++++++++++++++++++++---------
 Source/cmServerProtocol.h      |    2 +-
 Source/cmSourceFile.h          |    6 +++
 7 files changed, 124 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list