cmake/Source/cmGlobalBorlandMakefileGenerator.cxx

97 lines
3.4 KiB
C++
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGlobalBorlandMakefileGenerator.h"
2016-07-09 11:21:54 +02:00
2020-08-30 11:54:41 +02:00
#include <utility>
#include <cm/memory>
2017-04-14 19:02:05 +02:00
#include "cmDocumentationEntry.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
2019-11-11 23:01:05 +01:00
#include "cmMessageType.h"
2017-04-14 19:02:05 +02:00
#include "cmState.h"
#include "cmake.h"
2015-08-17 11:37:30 +02:00
cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator(cmake* cm)
: cmGlobalUnixMakefileGenerator3(cm)
{
this->EmptyRuleHackDepends = "NUL";
this->FindMakeProgramFile = "CMakeBorlandFindMake.cmake";
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
2015-08-17 11:37:30 +02:00
cm->GetState()->SetWindowsShell(true);
this->IncludeDirective = "!include";
this->DefineWindowsNULL = true;
this->PassMakeflags = true;
this->UnixCD = false;
2021-09-14 00:13:48 +02:00
/*
* Borland Make does not support long line depend rule, as we have tested
* generate one source file includes 40000 header files, and generate
* depend.make in one line(use line continued tag), and error occurred:
* ** Fatal CMakeFiles\main.dir\depend.make 1224: Rule line too long **
* we disable long line dependencies rule generation for Borland make
*/
this->ToolSupportsLongLineDependencies = false;
}
2016-07-09 11:21:54 +02:00
void cmGlobalBorlandMakefileGenerator::EnableLanguage(
std::vector<std::string> const& l, cmMakefile* mf, bool optional)
{
2015-08-17 11:37:30 +02:00
std::string outdir = this->CMakeInstance->GetHomeOutputDirectory();
mf->AddDefinition("BORLAND", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
2013-03-16 19:13:01 +02:00
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
}
2019-11-11 23:01:05 +01:00
//! Create a local generator appropriate to this Global Generator
2020-08-30 11:54:41 +02:00
std::unique_ptr<cmLocalGenerator>
cmGlobalBorlandMakefileGenerator::CreateLocalGenerator(cmMakefile* mf)
{
2020-08-30 11:54:41 +02:00
auto lg = cm::make_unique<cmLocalUnixMakefileGenerator3>(this, mf);
lg->SetMakefileVariableSize(32);
lg->SetMakeCommandEscapeTargetTwice(true);
lg->SetBorlandMakeCurlyHack(true);
2020-08-30 11:54:41 +02:00
return std::unique_ptr<cmLocalGenerator>(std::move(lg));
}
2016-07-09 11:21:54 +02:00
void cmGlobalBorlandMakefileGenerator::GetDocumentation(
cmDocumentationEntry& entry)
{
2013-03-16 19:13:01 +02:00
entry.Name = cmGlobalBorlandMakefileGenerator::GetActualName();
entry.Brief = "Generates Borland makefiles.";
}
2018-08-09 18:06:22 +02:00
2019-11-11 23:01:05 +01:00
std::vector<cmGlobalGenerator::GeneratedMakeCommand>
cmGlobalBorlandMakefileGenerator::GenerateBuildCommand(
const std::string& makeProgram, const std::string& projectName,
const std::string& projectDir, std::vector<std::string> const& targetNames,
const std::string& config, bool fast, int /*jobs*/, bool verbose,
std::vector<std::string> const& makeOptions)
2018-08-09 18:06:22 +02:00
{
2019-11-11 23:01:05 +01:00
return this->cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
makeProgram, projectName, projectDir, targetNames, config, fast,
cmake::NO_BUILD_PARALLEL_LEVEL, verbose, makeOptions);
2018-08-09 18:06:22 +02:00
}
void cmGlobalBorlandMakefileGenerator::PrintBuildCommandAdvice(
std::ostream& os, int jobs) const
{
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
// Borland's make does not support parallel builds
// see http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Make
/* clang-format off */
os <<
"Warning: Borland's make does not support parallel builds. "
"Ignoring parallel build command line option.\n";
/* clang-format on */
}
this->cmGlobalUnixMakefileGenerator3::PrintBuildCommandAdvice(
os, cmake::NO_BUILD_PARALLEL_LEVEL);
}