cmLocalVisualStudioGenerator.h 1.8 KB

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