cmGlobalWatcomWMakeGenerator.cxx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmGlobalWatcomWMakeGenerator.h"
  4. #include "cmDocumentationEntry.h"
  5. #include "cmMakefile.h"
  6. #include "cmState.h"
  7. #include "cmake.h"
  8. #include <ostream>
  9. cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm)
  10. : cmGlobalUnixMakefileGenerator3(cm)
  11. {
  12. this->FindMakeProgramFile = "CMakeFindWMake.cmake";
  13. #ifdef _WIN32
  14. this->ForceUnixPaths = false;
  15. #endif
  16. this->ToolSupportsColor = true;
  17. this->NeedSymbolicMark = true;
  18. this->EmptyRuleHackCommand = "@cd .";
  19. #ifdef _WIN32
  20. cm->GetState()->SetWindowsShell(true);
  21. #endif
  22. cm->GetState()->SetWatcomWMake(true);
  23. this->IncludeDirective = "!include";
  24. this->DefineWindowsNULL = true;
  25. this->UnixCD = false;
  26. this->MakeSilentFlag = "-h";
  27. }
  28. void cmGlobalWatcomWMakeGenerator::EnableLanguage(
  29. std::vector<std::string> const& l, cmMakefile* mf, bool optional)
  30. {
  31. // pick a default
  32. mf->AddDefinition("WATCOM", "1");
  33. mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
  34. mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
  35. mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
  36. mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
  37. mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
  38. mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
  39. this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
  40. }
  41. void cmGlobalWatcomWMakeGenerator::GetDocumentation(
  42. cmDocumentationEntry& entry)
  43. {
  44. entry.Name = cmGlobalWatcomWMakeGenerator::GetActualName();
  45. entry.Brief = "Generates Watcom WMake makefiles.";
  46. }
  47. void cmGlobalWatcomWMakeGenerator::GenerateBuildCommand(
  48. std::vector<std::string>& makeCommand, const std::string& makeProgram,
  49. const std::string& projectName, const std::string& projectDir,
  50. const std::string& targetName, const std::string& config, bool fast,
  51. int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
  52. {
  53. this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
  54. makeCommand, makeProgram, projectName, projectDir, targetName, config,
  55. fast, cmake::NO_BUILD_PARALLEL_LEVEL, verbose, makeOptions);
  56. }
  57. void cmGlobalWatcomWMakeGenerator::PrintBuildCommandAdvice(std::ostream& os,
  58. int jobs) const
  59. {
  60. if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
  61. // wmake does not support parallel build level
  62. /* clang-format off */
  63. os <<
  64. "Warning: Watcom's WMake does not support parallel builds. "
  65. "Ignoring parallel build command line option.\n";
  66. /* clang-format on */
  67. }
  68. this->cmGlobalUnixMakefileGenerator3::PrintBuildCommandAdvice(
  69. os, cmake::NO_BUILD_PARALLEL_LEVEL);
  70. }