cmVisualStudioGeneratorOptions.h 2.4 KB

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