1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
10 #include "cmGlobalVisualStudioGenerator.h"
11 #include "cmIDEFlagTable.h"
12 #include "cmIDEOptions.h"
14 class cmLocalVisualStudioGenerator;
16 using cmVS7FlagTable = cmIDEFlagTable;
18 class cmVisualStudioGeneratorOptions : public cmIDEOptions
21 // Construct an options table for a given tool.
33 cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
34 cmVS7FlagTable const* table = nullptr,
35 cmVS7FlagTable const* extraTable = nullptr);
37 // Add a table of flags.
38 void AddTable(cmVS7FlagTable const* table);
40 // Clear the flag tables.
43 // Store options from command line flags.
44 void Parse(const std::string& flags);
47 void PrependInheritedString(std::string const& key);
49 // Parse the content of the given flag table entry again to extract
50 // known flags and leave the rest in the original entry.
51 void Reparse(std::string const& key);
53 // Fix the ExceptionHandling option to default to off.
54 void FixExceptionHandlingDefault();
56 // Store options for verbose builds.
57 void SetVerboseMakefile(bool verbose);
59 // Check for specific options.
60 bool UsingUnicode() const;
61 bool UsingSBCS() const;
63 void FixCudaCodeGeneration();
65 void FixManifestUACFlags();
69 bool IsManaged() const;
70 // Write options to output.
71 void OutputPreprocessorDefinitions(std::ostream& fout, int indent,
72 const std::string& lang);
73 void OutputAdditionalIncludeDirectories(std::ostream& fout, int indent,
74 const std::string& lang);
75 void OutputFlagMap(std::ostream& fout, int indent);
76 void SetConfiguration(const std::string& config);
77 const std::string& GetConfiguration() const;
80 virtual void OutputFlag(std::ostream& fout, int indent,
81 const std::string& tag,
82 const std::string& content) = 0;
85 cmLocalVisualStudioGenerator* LocalGenerator;
86 cmGlobalVisualStudioGenerator::VSVersion Version;
88 std::string Configuration;
91 bool FortranRuntimeDebug;
92 bool FortranRuntimeDLL;
93 bool FortranRuntimeMT;
95 std::string UnknownFlagField;
97 void StoreUnknownFlag(std::string const& flag) override;
99 FlagValue TakeFlag(std::string const& key);