/src/CMake/Source/cmDependsCompiler.h
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 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <functional> |
8 | | #include <iosfwd> |
9 | | #include <string> |
10 | | #include <vector> |
11 | | |
12 | | #include "cmDepends.h" |
13 | | |
14 | | class cmLocalUnixMakefileGenerator3; |
15 | | |
16 | | /** \class cmDepends |
17 | | * \brief Dependencies files manager. |
18 | | * |
19 | | * This class is responsible for maintaining a compiler_depends.make file in |
20 | | * the build tree corresponding to an object file. |
21 | | */ |
22 | | class cmDependsCompiler |
23 | | { |
24 | | public: |
25 | 0 | cmDependsCompiler() = default; |
26 | | ~cmDependsCompiler() = default; |
27 | | |
28 | | /** should this be verbose in its output */ |
29 | 0 | void SetVerbose(bool verb) { this->Verbose = verb; } |
30 | | |
31 | | /** Set the local generator for the directory in which we are |
32 | | scanning dependencies. This is not a full local generator; it |
33 | | has been setup to do relative path conversions for the current |
34 | | directory. */ |
35 | | void SetLocalGenerator(cmLocalUnixMakefileGenerator3* lg) |
36 | 0 | { |
37 | 0 | this->LocalGenerator = lg; |
38 | 0 | } |
39 | | |
40 | | /** Read dependencies for the target file. Return true if |
41 | | dependencies didn't changed and false if not. |
42 | | Up-to-date Dependencies will be stored in deps. */ |
43 | | bool CheckDependencies( |
44 | | std::string const& internalDepFile, |
45 | | std::vector<std::string> const& depFiles, |
46 | | cmDepends::DependencyMap& dependencies, |
47 | | std::function<bool(std::string const&)> const& isValidPath); |
48 | | |
49 | | /** Write dependencies for the target file. */ |
50 | | void WriteDependencies(cmDepends::DependencyMap const& dependencies, |
51 | | std::ostream& makeDepends, |
52 | | std::ostream& internalDepends); |
53 | | |
54 | | /** Clear dependencies for the target so they will be regenerated. */ |
55 | | void ClearDependencies(std::vector<std::string> const& depFiles); |
56 | | |
57 | | private: |
58 | | bool Verbose = false; |
59 | | cmLocalUnixMakefileGenerator3* LocalGenerator = nullptr; |
60 | | }; |