resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmDependsCompiler.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt 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   cmDependsCompiler() = default;
26   ~cmDependsCompiler() = default;
27
28   /** should this be verbose in its output */
29   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   {
37     this->LocalGenerator = lg;
38   }
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     const std::string& internalDepFile,
45     const std::vector<std::string>& depFiles,
46     cmDepends::DependencyMap& dependencies,
47     const std::function<bool(const std::string&)>& isValidPath);
48
49   /** Write dependencies for the target file.  */
50   void WriteDependencies(const cmDepends::DependencyMap& dependencies,
51                          std::ostream& makeDepends,
52                          std::ostream& internalDepends);
53
54   /** Clear dependencies for the target so they will be regenerated.  */
55   void ClearDependencies(const std::vector<std::string>& depFiles);
56
57 private:
58   bool Verbose = false;
59   cmLocalUnixMakefileGenerator3* LocalGenerator = nullptr;
60 };