/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 "cmPolicies.h" |
11 | | #include "cmRuntimeDependencyArchive.h" |
12 | | #include "cmStringAlgorithms.h" |
13 | | |
14 | | cmBinUtilsLinker::cmBinUtilsLinker(cmRuntimeDependencyArchive* archive) |
15 | 0 | : Archive(archive) |
16 | 0 | { |
17 | 0 | } |
18 | | |
19 | | void cmBinUtilsLinker::SetError(std::string const& e) |
20 | 0 | { |
21 | 0 | this->Archive->SetError(e); |
22 | 0 | } |
23 | | |
24 | | void cmBinUtilsLinker::NormalizePath(std::string& path) const |
25 | 0 | { |
26 | 0 | std::string normalizedPath = |
27 | 0 | cmCMakePath(path, cmCMakePath::auto_format).GenericString(); |
28 | |
|
29 | 0 | if (path == normalizedPath) { |
30 | 0 | return; |
31 | 0 | } |
32 | | |
33 | 0 | cmPolicies::PolicyStatus policy = |
34 | 0 | this->Archive->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0207); |
35 | 0 | if (policy == cmPolicies::WARN) { |
36 | 0 | this->Archive->GetMakefile()->IssuePolicyWarning( |
37 | 0 | cmPolicies::CMP0207, {}, |
38 | 0 | cmStrCat("Path\n \"", path, "\"\nwould be converted to\n \"", |
39 | 0 | normalizedPath, "\"\n")); |
40 | 0 | } else if (policy == cmPolicies::NEW) { |
41 | 0 | path = std::move(normalizedPath); |
42 | 0 | } |
43 | 0 | } |