Skip to content
Snippets Groups Projects
Commit 186c9bff authored by Brad King's avatar Brad King
Browse files

NMake: Check nmake version for support of UTF-8

NMake version 9 and above support UTF-8 encoded makefiles with a BOM.
parent 8a4f536b
No related branches found
No related tags found
No related merge requests found
...@@ -63,11 +63,18 @@ bool cmGlobalNMakeMakefileGenerator::FindMakeProgram(cmMakefile* mf) ...@@ -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)
{ {
......
...@@ -55,8 +55,10 @@ protected: ...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment