mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 10:39:28 -05:00
ENH: add OPTIONAL keyword to ENABLE_LANGUAGE, so it will be possible to do
something like this: ENABLE_LANGUAGE(ASM-ATT) IF(CMAKE_ASM-ATT_COMPILER_WORKS) ... do assembler stufff ELSE(CMAKE_ASM-ATT_COMPILER_WORKS) ... fallback to generic C/C++ ENDIF(CMAKE_ASM-ATT_COMPILER_WORKS) Alex
This commit is contained in:
@@ -20,13 +20,29 @@
|
||||
bool cmEnableLanguageCommand
|
||||
::InitialPass(std::vector<std::string> const& args)
|
||||
{
|
||||
bool optional = false;
|
||||
std::vector<std::string> languages;
|
||||
if(args.size() < 1 )
|
||||
{
|
||||
this->SetError
|
||||
("ENABLE_LANGUAGE called with incorrect number of arguments");
|
||||
return false;
|
||||
}
|
||||
this->Makefile->EnableLanguage(args);
|
||||
for (std::vector<std::string>::const_iterator it = args.begin();
|
||||
it != args.end();
|
||||
++it)
|
||||
{
|
||||
if ((*it) == "OPTIONAL")
|
||||
{
|
||||
optional = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
languages.push_back(*it);
|
||||
}
|
||||
}
|
||||
|
||||
this->Makefile->EnableLanguage(languages, optional);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user