1 //===--- DependencyOutputOptions.h ------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
10 #define LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
17 /// ShowIncludesDestination - Destination for /showIncludes output.
18 enum class ShowIncludesDestination { None, Stdout, Stderr };
20 /// DependencyOutputFormat - Format for the compiler dependency file.
21 enum class DependencyOutputFormat { Make, NMake };
23 /// DependencyOutputOptions - Options for controlling the compiler dependency
25 class DependencyOutputOptions {
27 unsigned IncludeSystemHeaders : 1; ///< Include system header dependencies.
28 unsigned ShowHeaderIncludes : 1; ///< Show header inclusions (-H).
29 unsigned UsePhonyTargets : 1; ///< Include phony targets for each
30 /// dependency, which can avoid some 'make'
32 unsigned AddMissingHeaderDeps : 1; ///< Add missing headers to dependency list
33 unsigned IncludeModuleFiles : 1; ///< Include module file dependencies.
35 /// Destination of cl.exe style /showIncludes info.
36 ShowIncludesDestination ShowIncludesDest = ShowIncludesDestination::None;
38 /// The format for the dependency file.
39 DependencyOutputFormat OutputFormat = DependencyOutputFormat::Make;
41 /// The file to write dependency output to.
42 std::string OutputFile;
44 /// The file to write header include output to. This is orthogonal to
45 /// ShowHeaderIncludes (-H) and will include headers mentioned in the
46 /// predefines buffer. If the output file is "-", output will be sent to
48 std::string HeaderIncludeOutputFile;
50 /// A list of names to use as the targets in the dependency file; this list
51 /// must contain at least one entry.
52 std::vector<std::string> Targets;
54 /// A list of filenames to be used as extra dependencies for every target.
55 std::vector<std::string> ExtraDeps;
57 /// In /showIncludes mode, pretend the main TU is a header with this name.
58 std::string ShowIncludesPretendHeader;
60 /// The file to write GraphViz-formatted header dependencies to.
61 std::string DOTOutputFile;
63 /// The directory to copy module dependencies to when collecting them.
64 std::string ModuleDependencyOutputDir;
67 DependencyOutputOptions()
68 : IncludeSystemHeaders(0), ShowHeaderIncludes(0), UsePhonyTargets(0),
69 AddMissingHeaderDeps(0), IncludeModuleFiles(0) {}
72 } // end namespace clang