cmLocalVisualStudioGenerator.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 cmLocalVisualStudioGenerator_h
  4. #define cmLocalVisualStudioGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <map>
  7. #include <memory> // IWYU pragma: keep
  8. #include <string>
  9. #include "cmGlobalVisualStudioGenerator.h"
  10. #include "cmLocalGenerator.h"
  11. class cmCustomCommand;
  12. class cmCustomCommandGenerator;
  13. class cmGeneratorTarget;
  14. class cmGlobalGenerator;
  15. class cmMakefile;
  16. class cmSourceFile;
  17. /** \class cmLocalVisualStudioGenerator
  18. * \brief Base class for Visual Studio generators.
  19. *
  20. * cmLocalVisualStudioGenerator provides functionality common to all
  21. * Visual Studio generators.
  22. */
  23. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  24. {
  25. public:
  26. cmLocalVisualStudioGenerator(cmGlobalGenerator* gg, cmMakefile* mf);
  27. virtual ~cmLocalVisualStudioGenerator();
  28. /** Construct a script from the given list of command lines. */
  29. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  30. const std::string& newline = "\n");
  31. /** Label to which to jump in a batch file after a failed step in a
  32. sequence of custom commands. */
  33. const char* GetReportErrorLabel() const;
  34. cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
  35. virtual std::string ComputeLongestObjectDirectory(
  36. cmGeneratorTarget const*) const = 0;
  37. void ComputeObjectFilenames(
  38. std::map<cmSourceFile const*, std::string>& mapping,
  39. cmGeneratorTarget const* = 0) override;
  40. protected:
  41. virtual const char* ReportErrorLabel() const;
  42. virtual bool CustomCommandUseLocal() const { return false; }
  43. /** Construct a custom command to make exe import lib dir. */
  44. std::unique_ptr<cmCustomCommand> MaybeCreateImplibDir(
  45. cmGeneratorTarget* target, const std::string& config, bool isFortran);
  46. };
  47. #endif