cmLocalVisualStudioGenerator.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include "cmVsProjectType.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. ~cmLocalVisualStudioGenerator() override;
  28. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  29. const std::string& newline = "\n");
  30. std::string FinishConstructScript(VsProjectType projectType,
  31. const std::string& newline = "\n");
  32. /** Label to which to jump in a batch file after a failed step in a
  33. sequence of custom commands. */
  34. const char* GetReportErrorLabel() const;
  35. cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
  36. virtual std::string ComputeLongestObjectDirectory(
  37. cmGeneratorTarget const*) const = 0;
  38. void ComputeObjectFilenames(
  39. std::map<cmSourceFile const*, std::string>& mapping,
  40. cmGeneratorTarget const* = nullptr) override;
  41. protected:
  42. virtual const char* ReportErrorLabel() const;
  43. virtual bool CustomCommandUseLocal() const { return false; }
  44. /** Construct a custom command to make exe import lib dir. */
  45. std::unique_ptr<cmCustomCommand> MaybeCreateImplibDir(
  46. cmGeneratorTarget* target, const std::string& config, bool isFortran);
  47. };