cmGlobalNMakeMakefileGenerator.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 cmGlobalNMakeMakefileGenerator_h
  4. #define cmGlobalNMakeMakefileGenerator_h
  5. #include <iosfwd>
  6. #include <memory>
  7. #include "cmGlobalUnixMakefileGenerator3.h"
  8. /** \class cmGlobalNMakeMakefileGenerator
  9. * \brief Write a NMake makefiles.
  10. *
  11. * cmGlobalNMakeMakefileGenerator manages nmake build process for a tree
  12. */
  13. class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3
  14. {
  15. public:
  16. cmGlobalNMakeMakefileGenerator(cmake* cm);
  17. static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory()
  18. {
  19. return std::unique_ptr<cmGlobalGeneratorFactory>(
  20. new cmGlobalGeneratorSimpleFactory<cmGlobalNMakeMakefileGenerator>());
  21. }
  22. //! Get the name for the generator.
  23. std::string GetName() const override
  24. {
  25. return cmGlobalNMakeMakefileGenerator::GetActualName();
  26. }
  27. static std::string GetActualName() { return "NMake Makefiles"; }
  28. /** Get encoding used by generator for makefile files */
  29. codecvt::Encoding GetMakefileEncoding() const override
  30. {
  31. return codecvt::ANSI;
  32. }
  33. /** Get the documentation entry for this generator. */
  34. static void GetDocumentation(cmDocumentationEntry& entry);
  35. /**
  36. * Try to determine system information such as shared library
  37. * extension, pthreads, byte order etc.
  38. */
  39. void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
  40. bool optional) override;
  41. protected:
  42. std::vector<GeneratedMakeCommand> GenerateBuildCommand(
  43. const std::string& makeProgram, const std::string& projectName,
  44. const std::string& projectDir, std::vector<std::string> const& targetNames,
  45. const std::string& config, bool fast, int jobs, bool verbose,
  46. std::vector<std::string> const& makeOptions =
  47. std::vector<std::string>()) override;
  48. void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;
  49. private:
  50. void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
  51. const char* envVar) const override;
  52. };
  53. #endif