Coverage Report

Created: 2026-03-12 06:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmBinUtilsLinker.cxx
Line
Count
Source
1
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2
   file LICENSE.rst or https://cmake.org/licensing for details.  */
3
4
#include "cmBinUtilsLinker.h"
5
6
#include <utility>
7
8
#include "cmCMakePath.h"
9
#include "cmMakefile.h"
10
#include "cmMessageType.h"
11
#include "cmPolicies.h"
12
#include "cmRuntimeDependencyArchive.h"
13
#include "cmStringAlgorithms.h"
14
15
cmBinUtilsLinker::cmBinUtilsLinker(cmRuntimeDependencyArchive* archive)
16
0
  : Archive(archive)
17
0
{
18
0
}
19
20
void cmBinUtilsLinker::SetError(std::string const& e)
21
0
{
22
0
  this->Archive->SetError(e);
23
0
}
24
25
void cmBinUtilsLinker::NormalizePath(std::string& path) const
26
0
{
27
0
  std::string normalizedPath =
28
0
    cmCMakePath(path, cmCMakePath::auto_format).GenericString();
29
30
0
  if (path == normalizedPath) {
31
0
    return;
32
0
  }
33
34
0
  cmPolicies::PolicyStatus policy =
35
0
    this->Archive->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0207);
36
0
  if (policy == cmPolicies::WARN) {
37
0
    this->Archive->GetMakefile()->IssueMessage(
38
0
      MessageType::AUTHOR_WARNING,
39
0
      cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0207),
40
0
               "\n"
41
0
               "Path\n  \"",
42
0
               path,
43
0
               "\"\n"
44
0
               "would be converted to\n  \"",
45
0
               normalizedPath, "\"\n"));
46
0
  } else if (policy == cmPolicies::NEW) {
47
0
    path = std::move(normalizedPath);
48
0
  }
49
0
}