浏览代码

instrument: don't report target=TARGET_NAME

Remove the erroneous default target name when instrumenting
custom commands.
Zack Galbreath 8 月之前
父节点
当前提交
85a63143ed

+ 1 - 1
Help/manual/cmake-instrumentation.7.rst

@@ -270,7 +270,7 @@ and contain the following data:
 
   ``target``
     The CMake target associated with the command. Only included when ``role`` is
-    one of ``compile``, ``link``, ``custom``.
+    ``compile`` or ``link``.
 
   ``targetType``
     The :prop_tgt:`TYPE` of the target. Only included when ``role`` is

+ 3 - 1
Source/CTest/cmCTestLaunch.cxx

@@ -268,7 +268,9 @@ int cmCTestLaunch::Run()
 {
   auto instrumentation = cmInstrumentation(this->Reporter.OptionBuildDir);
   std::map<std::string, std::string> options;
-  options["target"] = this->Reporter.OptionTargetName;
+  if (this->Reporter.OptionTargetName != "TARGET_NAME") {
+    options["target"] = this->Reporter.OptionTargetName;
+  }
   options["source"] = this->Reporter.OptionSource;
   options["language"] = this->Reporter.OptionLanguage;
   options["targetType"] = this->Reporter.OptionTargetType;

+ 0 - 1
Tests/RunCMake/Instrumentation/verify-snippet.cmake

@@ -49,7 +49,6 @@ function(snippet_has_fields snippet contents)
     has_key("${snippet}" "${contents}" language)
     has_key("${snippet}" "${contents}" config)
   elseif (filename MATCHES "^custom-*")
-    has_key("${snippet}" "${contents}" target)
     has_key("${snippet}" "${contents}" outputs)
     has_key("${snippet}" "${contents}" outputSizes)
   elseif (filename MATCHES "^test-*")