modified MATCHES to handle non variables
This commit is contained in:
parent
159338bcf8
commit
20d9083455
|
@ -145,10 +145,14 @@ bool cmElseCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
if (args.size() == 3 && (args[1] == "MATCHES"))
|
if (args.size() == 3 && (args[1] == "MATCHES"))
|
||||||
{
|
{
|
||||||
def = m_Makefile->GetDefinition(args[0].c_str());
|
def = m_Makefile->GetDefinition(args[0].c_str());
|
||||||
|
if (!def)
|
||||||
|
{
|
||||||
|
def = args[0].c_str();
|
||||||
|
}
|
||||||
cmRegularExpression regEntry(args[2].c_str());
|
cmRegularExpression regEntry(args[2].c_str());
|
||||||
|
|
||||||
// check for black line or comment
|
// check for black line or comment
|
||||||
if (def && regEntry.find(def))
|
if (regEntry.find(def))
|
||||||
{
|
{
|
||||||
f = new cmIfFunctionBlocker();
|
f = new cmIfFunctionBlocker();
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,10 +140,14 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
if (args.size() == 3 && (args[1] == "MATCHES"))
|
if (args.size() == 3 && (args[1] == "MATCHES"))
|
||||||
{
|
{
|
||||||
def = m_Makefile->GetDefinition(args[0].c_str());
|
def = m_Makefile->GetDefinition(args[0].c_str());
|
||||||
|
if (!def)
|
||||||
|
{
|
||||||
|
def = args[0].c_str();
|
||||||
|
}
|
||||||
cmRegularExpression regEntry(args[2].c_str());
|
cmRegularExpression regEntry(args[2].c_str());
|
||||||
|
|
||||||
// check for black line or comment
|
// check for black line or comment
|
||||||
if (!def || !regEntry.find(def))
|
if (!regEntry.find(def))
|
||||||
{
|
{
|
||||||
f = new cmIfFunctionBlocker();
|
f = new cmIfFunctionBlocker();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue