instrument: don't report target=TARGET_NAME

Remove the erroneous default target name when instrumenting
custom commands.
This commit is contained in:
Zack Galbreath
2025-02-14 09:05:54 -05:00
committed by Brad King
parent 1d274d34b9
commit 85a63143ed
3 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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-*")