cmVisualStudioGeneratorOptions.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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>
  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. bool IsDebug() const;
  54. bool IsWinRt() const;
  55. bool IsManaged() const;
  56. // Write options to output.
  57. void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix,
  58. const char* suffix,
  59. const std::string& lang);
  60. void OutputFlagMap(std::ostream& fout, const char* indent);
  61. void SetConfiguration(const char* config);
  62. private:
  63. cmLocalVisualStudioGenerator* LocalGenerator;
  64. cmGlobalVisualStudioGenerator::VSVersion Version;
  65. std::string Configuration;
  66. Tool CurrentTool;
  67. cmVisualStudio10TargetGenerator* TargetGenerator;
  68. bool FortranRuntimeDebug;
  69. bool FortranRuntimeDLL;
  70. bool FortranRuntimeMT;
  71. std::string UnknownFlagField;
  72. virtual void StoreUnknownFlag(const char* flag);
  73. FlagValue TakeFlag(std::string const& key);
  74. };
  75. #endif