diff options
author | James Johnston <johnstonj.public@codenest.com> | 2015-08-05 21:23:07 (GMT) |
---|---|---|
committer | James Johnston <johnstonj.public@codenest.com> | 2015-08-06 17:32:43 (GMT) |
commit | afeb4eb243e01df5c7396dc346f2629b21115e2c (patch) | |
tree | 0ed8f16b6ebc6d9ad28e3fc2397821cb4c6afb7c /Source/cmGlobalNMakeMakefileGenerator.cxx | |
parent | 22590805bffe74c3b4998152556561a2c2b6d177 (diff) | |
download | CMake-afeb4eb243e01df5c7396dc346f2629b21115e2c.zip CMake-afeb4eb243e01df5c7396dc346f2629b21115e2c.tar.gz CMake-afeb4eb243e01df5c7396dc346f2629b21115e2c.tar.bz2 |
nmake/jom: Only warn about bad VS environment if compiler not found.
nmake and jom generators no longer warn about missing INCLUDE/LIB
environment variables unless the C/CXX compiler cannot be found. This
is useful if the user does not want to use these generators with the
Visual C++ compiler, or they do not want to enable any language.
Diffstat (limited to 'Source/cmGlobalNMakeMakefileGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNMakeMakefileGenerator.cxx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 4219c34..7c570a6 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -36,18 +36,6 @@ void cmGlobalNMakeMakefileGenerator // pick a default mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); - if(!(cmSystemTools::GetEnv("INCLUDE") && - cmSystemTools::GetEnv("LIB")) - ) - { - std::string message = "To use the NMake generator, cmake must be run " - "from a shell that can use the compiler cl from the command line. " - "This environment does not contain INCLUDE, LIB, or LIBPATH, and " - "these must be set for the cl compiler to work. "; - mf->IssueMessage(cmake::WARNING, - message); - } - this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional); } @@ -58,3 +46,19 @@ void cmGlobalNMakeMakefileGenerator entry.Name = cmGlobalNMakeMakefileGenerator::GetActualName(); entry.Brief = "Generates NMake makefiles."; } + +//---------------------------------------------------------------------------- +void cmGlobalNMakeMakefileGenerator::PrintCompilerAdvice(std::ostream& os, + std::string const& lang, + const char* envVar) const +{ + if(lang == "CXX" || lang == "C") + { + os << + "To use the NMake generator with Visual C++, cmake must be run from a " + "shell that can use the compiler cl from the command line. This " + "environment is unable to invoke the cl compiler. To fix this problem, " + "run cmake from the Visual Studio Command Prompt (vcvarsall.bat).\n"; + } + this->cmGlobalUnixMakefileGenerator3::PrintCompilerAdvice(os, lang, envVar); +} |