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"
7 #include "cmDocumentationEntry.h"
8 #include "cmGlobalGenerator.h"
9 #include "cmMakefile.h"
13 cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm)
14 : cmGlobalUnixMakefileGenerator3(cm)
16 this->FindMakeProgramFile = "CMakeFindWMake.cmake";
18 this->ForceUnixPaths = false;
20 this->ToolSupportsColor = true;
21 this->NeedSymbolicMark = true;
22 this->EmptyRuleHackCommand = "@%null";
24 cm->GetState()->SetWindowsShell(true);
26 cm->GetState()->SetWatcomWMake(true);
27 this->IncludeDirective = "!include";
28 this->LineContinueDirective = "&\n";
29 this->DefineWindowsNULL = true;
31 this->MakeSilentFlag = "-h";
34 void cmGlobalWatcomWMakeGenerator::EnableLanguage(
35 std::vector<std::string> const& l, cmMakefile* mf, bool optional)
38 mf->AddDefinition("WATCOM", "1");
39 mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
40 mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
41 mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
42 mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
43 mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
44 this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
47 bool cmGlobalWatcomWMakeGenerator::SetSystemName(std::string const& s,
50 if (mf->GetSafeDefinition("CMAKE_SYSTEM_PROCESSOR") == "I86") {
51 mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl");
52 mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl");
54 return this->cmGlobalUnixMakefileGenerator3::SetSystemName(s, mf);
57 void cmGlobalWatcomWMakeGenerator::GetDocumentation(
58 cmDocumentationEntry& entry)
60 entry.Name = cmGlobalWatcomWMakeGenerator::GetActualName();
61 entry.Brief = "Generates Watcom WMake makefiles.";
64 std::vector<cmGlobalGenerator::GeneratedMakeCommand>
65 cmGlobalWatcomWMakeGenerator::GenerateBuildCommand(
66 const std::string& makeProgram, const std::string& projectName,
67 const std::string& projectDir, std::vector<std::string> const& targetNames,
68 const std::string& config, int /*jobs*/, bool verbose,
69 const cmBuildOptions& buildOptions,
70 std::vector<std::string> const& makeOptions)
72 return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
73 makeProgram, projectName, projectDir, targetNames, config,
74 cmake::NO_BUILD_PARALLEL_LEVEL, verbose, buildOptions, makeOptions);
77 void cmGlobalWatcomWMakeGenerator::PrintBuildCommandAdvice(std::ostream& os,
80 if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
81 // wmake does not support parallel build level
83 /* clang-format off */
85 "Warning: Watcom's WMake does not support parallel builds. "
86 "Ignoring parallel build command line option.\n";
90 this->cmGlobalUnixMakefileGenerator3::PrintBuildCommandAdvice(
91 os, cmake::NO_BUILD_PARALLEL_LEVEL);