cmGlobalVisualStudio7Generator.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file LICENSE.rst or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include <iosfwd>
  5. #include <map>
  6. #include <memory>
  7. #include <set>
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. #include <cm/optional>
  12. #include <cm3p/json/value.h>
  13. #include "cmGlobalVisualStudioGenerator.h"
  14. #include "cmValue.h"
  15. class cmGeneratorTarget;
  16. struct cmIDEFlagTable;
  17. class cmLocalGenerator;
  18. class cmMakefile;
  19. class cmake;
  20. template <typename T>
  21. class BT;
  22. /** \class cmGlobalVisualStudio7Generator
  23. * \brief Write a Unix makefiles.
  24. *
  25. * cmGlobalVisualStudio7Generator manages UNIX build process for a tree
  26. */
  27. class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
  28. {
  29. public:
  30. ~cmGlobalVisualStudio7Generator() override;
  31. //! Create a local generator appropriate to this Global Generator
  32. std::unique_ptr<cmLocalGenerator> CreateLocalGenerator(
  33. cmMakefile* mf) override;
  34. #if !defined(CMAKE_BOOTSTRAP)
  35. Json::Value GetJson() const override;
  36. #endif
  37. bool SetSystemName(std::string const& s, cmMakefile* mf) override;
  38. /**
  39. * Utilized by the generator factory to determine if this generator
  40. * supports toolsets.
  41. */
  42. static bool SupportsToolset() { return false; }
  43. /**
  44. * Utilized by the generator factory to determine if this generator
  45. * supports platforms.
  46. */
  47. static bool SupportsPlatform() { return false; }
  48. /**
  49. * Try to determine system information such as shared library
  50. * extension, pthreads, byte order etc.
  51. */
  52. void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
  53. bool optional) override;
  54. /**
  55. * Try running cmake and building a file. This is used for dynamically
  56. * loaded commands, not as part of the usual build process.
  57. */
  58. std::vector<GeneratedMakeCommand> GenerateBuildCommand(
  59. std::string const& makeProgram, std::string const& projectName,
  60. std::string const& projectDir, std::vector<std::string> const& targetNames,
  61. std::string const& config, int jobs, bool verbose,
  62. cmBuildOptions buildOptions = cmBuildOptions(),
  63. std::vector<std::string> const& makeOptions =
  64. std::vector<std::string>()) override;
  65. /** Append the subdirectory for the given configuration. */
  66. void AppendDirectoryForConfig(std::string const& prefix,
  67. std::string const& config,
  68. std::string const& suffix,
  69. std::string& dir) override;
  70. //! What is the configurations directory variable called?
  71. char const* GetCMakeCFGIntDir() const override
  72. {
  73. return "$(ConfigurationName)";
  74. }
  75. /** Return true if the target project file should have the option
  76. LinkLibraryDependencies and link to .sln dependencies. */
  77. virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget*)
  78. {
  79. return false;
  80. }
  81. std::string const& GetIntelProjectVersion();
  82. virtual cm::optional<std::string> GetPlatformToolsetFortran() const
  83. {
  84. return cm::nullopt;
  85. }
  86. bool FindMakeProgram(cmMakefile* mf) override;
  87. /** Is the Microsoft Assembler enabled? */
  88. bool IsMarmasmEnabled() const { return this->MarmasmEnabled; }
  89. bool IsMasmEnabled() const { return this->MasmEnabled; }
  90. bool IsNasmEnabled() const { return this->NasmEnabled; }
  91. // Encoding for Visual Studio files
  92. virtual std::string Encoding();
  93. cmIDEFlagTable const* ExtraFlagTable;
  94. virtual bool SupportsCxxModuleDyndep() const { return false; }
  95. protected:
  96. cmGlobalVisualStudio7Generator(cmake* cm);
  97. std::string const& GetDevEnvCommand();
  98. virtual std::string FindDevEnvCommand();
  99. static char const* ExternalProjectType(std::string const& location);
  100. bool MarmasmEnabled;
  101. bool MasmEnabled;
  102. bool NasmEnabled;
  103. private:
  104. std::string IntelProjectVersion;
  105. std::string DevEnvCommand;
  106. bool DevEnvCommandInitialized;
  107. std::string GetVSMakeProgram() override { return this->GetDevEnvCommand(); }
  108. };
  109. #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"