1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 22:37:30 +08:00

NMake: Check nmake version for support of UTF-8

NMake version 9 and above support UTF-8 encoded makefiles with a BOM.
This commit is contained in:
Brad King
2021-04-28 13:14:31 -04:00
parent 8a4f536be6
commit 186c9bff53
2 changed files with 9 additions and 0 deletions

View File

@@ -63,11 +63,18 @@ bool cmGlobalNMakeMakefileGenerator::FindMakeProgram(cmMakefile* mf)
"Program Maintenance Utility Version ([1-9][0-9.]+)"); "Program Maintenance Utility Version ([1-9][0-9.]+)");
if (regex.find(err)) { if (regex.find(err)) {
this->NMakeVersion = regex.match(1); this->NMakeVersion = regex.match(1);
this->CheckNMakeFeatures();
} }
} }
return true; return true;
} }
void cmGlobalNMakeMakefileGenerator::CheckNMakeFeatures()
{
this->NMakeSupportsUTF8 = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NMakeVersion.c_str(), "9");
}
void cmGlobalNMakeMakefileGenerator::GetDocumentation( void cmGlobalNMakeMakefileGenerator::GetDocumentation(
cmDocumentationEntry& entry) cmDocumentationEntry& entry)
{ {

View File

@@ -55,8 +55,10 @@ protected:
void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override; void PrintBuildCommandAdvice(std::ostream& os, int jobs) const override;
private: private:
bool NMakeSupportsUTF8 = false;
std::string NMakeVersion; std::string NMakeVersion;
bool FindMakeProgram(cmMakefile* mf) override; bool FindMakeProgram(cmMakefile* mf) override;
void CheckNMakeFeatures();
void PrintCompilerAdvice(std::ostream& os, std::string const& lang, void PrintCompilerAdvice(std::ostream& os, std::string const& lang,
const char* envVar) const override; const char* envVar) const override;