Ninja: Identifier encoding rules for ' ' and ':'
This commit is contained in:
parent
99856d537c
commit
9362440a0b
@ -56,7 +56,8 @@ static bool IsIdentChar(char c)
|
|||||||
('a' <= c && c <= 'z') ||
|
('a' <= c && c <= 'z') ||
|
||||||
('+' <= c && c <= '9') || // +,-./ and numbers
|
('+' <= c && c <= '9') || // +,-./ and numbers
|
||||||
('A' <= c && c <= 'Z') ||
|
('A' <= c && c <= 'Z') ||
|
||||||
(c == '_') || (c == '$') || (c == '\\');
|
(c == '_') || (c == '$') || (c == '\\') ||
|
||||||
|
(c == ' ') || (c == ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident,
|
std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident,
|
||||||
@ -69,7 +70,10 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident,
|
|||||||
vars << names.str() << " = " << ident << "\n";
|
vars << names.str() << " = " << ident << "\n";
|
||||||
return "$" + names.str();
|
return "$" + names.str();
|
||||||
} else {
|
} else {
|
||||||
return ident;
|
std::string result = ident;
|
||||||
|
cmSystemTools::ReplaceString(result, " ", "$ ");
|
||||||
|
cmSystemTools::ReplaceString(result, ":", "$:");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user