cmVisualStudioGeneratorOptions.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmVisualStudioGeneratorOptions_h
  4. #define cmVisualStudioGeneratorOptions_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. #include <string>
  8. #include "cmGlobalVisualStudioGenerator.h"
  9. #include "cmIDEFlagTable.h"
  10. #include "cmIDEOptions.h"
  11. class cmLocalVisualStudioGenerator;
  12. typedef cmIDEFlagTable cmVS7FlagTable;
  13. class cmVisualStudio10TargetGenerator;
  14. class cmVisualStudioGeneratorOptions : public cmIDEOptions
  15. {
  16. public:
  17. // Construct an options table for a given tool.
  18. enum Tool
  19. {
  20. Compiler,
  21. ResourceCompiler,
  22. CudaCompiler,
  23. MasmCompiler,
  24. NasmCompiler,
  25. Linker,
  26. FortranCompiler,
  27. CSharpCompiler
  28. };
  29. cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
  30. cmVS7FlagTable const* table,
  31. cmVS7FlagTable const* extraTable = 0,
  32. cmVisualStudio10TargetGenerator* g = 0);
  33. cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
  34. cmVisualStudio10TargetGenerator* g = 0);
  35. // Add a table of flags.
  36. void AddTable(cmVS7FlagTable const* table);
  37. // Clear the flag tables.
  38. void ClearTables();
  39. // Store options from command line flags.
  40. void Parse(const char* flags);
  41. void ParseFinish();
  42. void PrependInheritedString(std::string const& key);
  43. // Parse the content of the given flag table entry again to extract
  44. // known flags and leave the rest in the original entry.
  45. void Reparse(std::string const& key);
  46. // Fix the ExceptionHandling option to default to off.
  47. void FixExceptionHandlingDefault();
  48. // Store options for verbose builds.
  49. void SetVerboseMakefile(bool verbose);
  50. // Check for specific options.
  51. bool UsingUnicode() const;
  52. bool UsingSBCS() const;
  53. enum CudaRuntime
  54. {
  55. CudaRuntimeStatic,
  56. CudaRuntimeShared,
  57. CudaRuntimeNone
  58. };
  59. CudaRuntime GetCudaRuntime() const;
  60. void FixCudaCodeGeneration();
  61. void FixManifestUACFlags();
  62. bool IsDebug() const;
  63. bool IsWinRt() const;
  64. bool IsManaged() const;
  65. // Write options to output.
  66. void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix,
  67. const char* suffix,
  68. const std::string& lang);
  69. void OutputAdditionalIncludeDirectories(std::ostream& fout,
  70. const char* prefix,
  71. const char* suffix,
  72. const std::string& lang);
  73. void OutputFlagMap(std::ostream& fout, const char* indent);
  74. void SetConfiguration(const char* config);
  75. private:
  76. cmLocalVisualStudioGenerator* LocalGenerator;
  77. cmGlobalVisualStudioGenerator::VSVersion Version;
  78. std::string Configuration;
  79. Tool CurrentTool;
  80. cmVisualStudio10TargetGenerator* TargetGenerator;
  81. bool FortranRuntimeDebug;
  82. bool FortranRuntimeDLL;
  83. bool FortranRuntimeMT;
  84. std::string UnknownFlagField;
  85. virtual void StoreUnknownFlag(const char* flag);
  86. FlagValue TakeFlag(std::string const& key);
  87. };
  88. #endif