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. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2018-08-09 18:06:22 +02:00
|
|
|
#include <iosfwd>
|
2020-08-30 11:54:41 +02:00
|
|
|
#include <memory>
|
2022-03-29 21:10:50 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2018-08-09 18:06:22 +02:00
|
|
|
|
2022-03-29 21:10:50 +02:00
|
|
|
#include "cm_codecvt.hxx"
|
|
|
|
|
|
|
|
#include "cmGlobalGeneratorFactory.h"
|
2020-02-01 23:06:01 +01:00
|
|
|
#include "cmGlobalUnixMakefileGenerator3.h"
|
2022-03-29 21:10:50 +02:00
|
|
|
#include "cmValue.h"
|
|
|
|
|
|
|
|
class cmMakefile;
|
|
|
|
class cmake;
|
2020-02-01 23:06:01 +01:00
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
/** \class cmGlobalNMakeMakefileGenerator
|
|
|
|
* \brief Write a NMake makefiles.
|
|
|
|
*
|
|
|
|
* cmGlobalNMakeMakefileGenerator manages nmake build process for a tree
|
|
|
|
*/
|
|
|
|
class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3
|
|
|
|
{
|
|
|
|
public:
|
2015-08-17 11:37:30 +02:00
|
|
|
cmGlobalNMakeMakefileGenerator(cmake* cm);
|
2020-08-30 11:54:41 +02:00
|
|
|
static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory()
|
2016-07-09 11:21:54 +02:00
|
|
|
{
|
2020-08-30 11:54:41 +02:00
|
|
|
return std::unique_ptr<cmGlobalGeneratorFactory>(
|
|
|
|
new cmGlobalGeneratorSimpleFactory<cmGlobalNMakeMakefileGenerator>());
|
2016-07-09 11:21:54 +02:00
|
|
|
}
|
2019-11-11 23:01:05 +01:00
|
|
|
//! Get the name for the generator.
|
2018-08-09 18:06:22 +02:00
|
|
|
std::string GetName() const override
|
2016-07-09 11:21:54 +02:00
|
|
|
{
|
|
|
|
return cmGlobalNMakeMakefileGenerator::GetActualName();
|
|
|
|
}
|
|
|
|
static std::string GetActualName() { return "NMake Makefiles"; }
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
/** Get encoding used by generator for makefile files */
|
2018-01-26 17:06:56 +01:00
|
|
|
codecvt::Encoding GetMakefileEncoding() const override
|
2017-04-14 19:02:05 +02:00
|
|
|
{
|
2021-09-14 00:13:48 +02:00
|
|
|
return this->NMakeSupportsUTF8 ? codecvt::UTF8_WITH_BOM : codecvt::ANSI;
|
2017-04-14 19:02:05 +02:00
|
|
|
}
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
/** Get the documentation entry for this generator. */
|
2023-05-23 16:38:00 +02:00
|
|
|
static cmDocumentationEntry GetDocumentation();
|
2013-03-16 19:13:01 +02:00
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
/**
|
2015-04-27 22:25:09 +02:00
|
|
|
* Try to determine system information such as shared library
|
2013-03-16 19:13:01 +02:00
|
|
|
* extension, pthreads, byte order etc.
|
2008-10-12 18:41:06 +02:00
|
|
|
*/
|
2018-08-09 18:06:22 +02:00
|
|
|
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
|
|
|
|
bool optional) override;
|
|
|
|
|
|
|
|
protected:
|
2019-11-11 23:01:05 +01:00
|
|
|
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
|
|
|
|
const std::string& makeProgram, const std::string& projectName,
|
|
|
|
const std::string& projectDir, std::vector<std::string> const& targetNames,
|
2022-03-29 21:10:50 +02:00
|
|
|
const std::string& config, int jobs, bool verbose,
|
|
|
|
const cmBuildOptions& buildOptions = cmBuildOptions(),
|
2019-11-11 23:01:05 +01:00
|
|
|
std::vector<std::string> const& makeOptions =
|
|
|
|
std::vector<std::string>()) override;
|
2018-08-09 18:06:22 +02:00
|
|
|
|
|
|
|
void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;
|
2016-07-09 11:21:54 +02:00
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
private:
|
2021-09-14 00:13:48 +02:00
|
|
|
bool NMakeSupportsUTF8 = false;
|
|
|
|
std::string NMakeVersion;
|
|
|
|
bool FindMakeProgram(cmMakefile* mf) override;
|
|
|
|
void CheckNMakeFeatures();
|
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
|
2021-11-20 13:41:27 +01:00
|
|
|
cmValue envVar) const override;
|
2008-10-12 18:41:06 +02:00
|
|
|
};
|