cmVisualStudioGeneratorOptions.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. MasmCompiler,
  23. NasmCompiler,
  24. Linker,
  25. FortranCompiler,
  26. CSharpCompiler
  27. };
  28. cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
  29. cmVS7FlagTable const* table,
  30. cmVS7FlagTable const* extraTable = 0,
  31. cmVisualStudio10TargetGenerator* g = 0);
  32. cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
  33. cmVisualStudio10TargetGenerator* g = 0);
  34. // Add a table of flags.
  35. void AddTable(cmVS7FlagTable const* table);
  36. // Clear the flag tables.
  37. void ClearTables();
  38. // Store options from command line flags.
  39. void Parse(const char* flags);
  40. void ParseFinish();
  41. void PrependInheritedString(std::string const& key);
  42. // Parse the content of the given flag table entry again to extract
  43. // known flags and leave the rest in the original entry.
  44. void Reparse(std::string const& key);
  45. // Fix the ExceptionHandling option to default to off.
  46. void FixExceptionHandlingDefault();
  47. // Store options for verbose builds.
  48. void SetVerboseMakefile(bool verbose);
  49. // Check for specific options.
  50. bool UsingUnicode() const;
  51. bool UsingSBCS() const;
  52. bool IsDebug() const;
  53. bool IsWinRt() const;
  54. bool IsManaged() const;
  55. // Write options to output.
  56. void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix,
  57. const char* suffix,
  58. const std::string& lang);
  59. void OutputFlagMap(std::ostream& fout, const char* indent);
  60. void SetConfiguration(const char* config);
  61. private:
  62. cmLocalVisualStudioGenerator* LocalGenerator;
  63. cmGlobalVisualStudioGenerator::VSVersion Version;
  64. std::string Configuration;
  65. Tool CurrentTool;
  66. cmVisualStudio10TargetGenerator* TargetGenerator;
  67. bool FortranRuntimeDebug;
  68. bool FortranRuntimeDLL;
  69. bool FortranRuntimeMT;
  70. std::string UnknownFlagField;
  71. virtual void StoreUnknownFlag(const char* flag);
  72. FlagValue TakeFlag(std::string const& key);
  73. };
  74. #endif