2009-11-05 23:00:15 +03:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
|
|
|
#include "cmGlobalJOMMakefileGenerator.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2009-11-05 23:00:15 +03:00
|
|
|
#include "cmLocalUnixMakefileGenerator3.h"
|
|
|
|
#include "cmMakefile.h"
|
|
|
|
|
2015-05-24 12:31:14 +03:00
|
|
|
cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator(cmake* cm)
|
|
|
|
: cmGlobalUnixMakefileGenerator3(cm)
|
2009-11-05 23:00:15 +03:00
|
|
|
{
|
|
|
|
this->FindMakeProgramFile = "CMakeJOMFindMake.cmake";
|
|
|
|
this->ForceUnixPaths = false;
|
|
|
|
this->ToolSupportsColor = true;
|
|
|
|
this->UseLinkScript = false;
|
2015-05-24 12:46:30 +03:00
|
|
|
cm->GetState()->SetWindowsShell(true);
|
|
|
|
cm->GetState()->SetNMake(true);
|
2015-05-16 06:20:36 +03:00
|
|
|
this->DefineWindowsNULL = true;
|
2015-05-16 06:20:58 +03:00
|
|
|
this->PassMakeflags = true;
|
2015-05-16 06:21:24 +03:00
|
|
|
this->UnixCD = false;
|
2015-05-16 06:23:06 +03:00
|
|
|
this->MakeSilentFlag = "/nologo";
|
2009-11-05 23:00:15 +03:00
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void cmGlobalJOMMakefileGenerator::EnableLanguage(
|
|
|
|
std::vector<std::string> const& l, cmMakefile* mf, bool optional)
|
2009-11-05 23:00:15 +03:00
|
|
|
{
|
2012-08-13 21:42:58 +04:00
|
|
|
// pick a default
|
2009-11-05 23:00:15 +03:00
|
|
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
|
|
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
|
|
|
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
|
|
|
|
}
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void cmGlobalJOMMakefileGenerator::GetDocumentation(
|
|
|
|
cmDocumentationEntry& entry)
|
2009-11-05 23:00:15 +03:00
|
|
|
{
|
2012-11-19 19:42:24 +04:00
|
|
|
entry.Name = cmGlobalJOMMakefileGenerator::GetActualName();
|
2009-11-05 23:00:15 +03:00
|
|
|
entry.Brief = "Generates JOM makefiles.";
|
|
|
|
}
|
2015-08-06 00:23:07 +03:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void cmGlobalJOMMakefileGenerator::PrintCompilerAdvice(
|
|
|
|
std::ostream& os, std::string const& lang, const char* envVar) const
|
2015-08-06 00:23:07 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (lang == "CXX" || lang == "C") {
|
2016-05-06 21:19:04 +03:00
|
|
|
/* clang-format off */
|
2015-08-06 00:23:07 +03:00
|
|
|
os <<
|
|
|
|
"To use the JOM 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";
|
2016-05-06 21:19:04 +03:00
|
|
|
/* clang-format on */
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2015-08-06 00:23:07 +03:00
|
|
|
this->cmGlobalUnixMakefileGenerator3::PrintCompilerAdvice(os, lang, envVar);
|
|
|
|
}
|