Ninja: Add multi-config variant

Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
This commit is contained in:
Kyle Edwards
2019-11-15 13:01:36 -05:00
parent 3bc63e99e4
commit 5a8a9f7229
54 changed files with 1264 additions and 416 deletions

View File

@@ -23,6 +23,7 @@ cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
, OutputConverter(outputConverter)
, ForResponse(false)
, UseWatcomQuote(false)
, UseNinjaMulti(false)
, Relink(false)
{
}
@@ -34,6 +35,11 @@ void cmLinkLineComputer::SetUseWatcomQuote(bool useWatcomQuote)
this->UseWatcomQuote = useWatcomQuote;
}
void cmLinkLineComputer::SetUseNinjaMulti(bool useNinjaMulti)
{
this->UseNinjaMulti = useNinjaMulti;
}
void cmLinkLineComputer::SetForResponse(bool forResponse)
{
this->ForResponse = forResponse;
@@ -106,10 +112,14 @@ void cmLinkLineComputer::ComputeLinkLibs(
std::string cmLinkLineComputer::ConvertToOutputFormat(std::string const& input)
{
cmOutputConverter::OutputFormat shellFormat = (this->ForResponse)
? cmOutputConverter::RESPONSE
: ((this->UseWatcomQuote) ? cmOutputConverter::WATCOMQUOTE
: cmOutputConverter::SHELL);
cmOutputConverter::OutputFormat shellFormat = cmOutputConverter::SHELL;
if (this->ForResponse) {
shellFormat = cmOutputConverter::RESPONSE;
} else if (this->UseWatcomQuote) {
shellFormat = cmOutputConverter::WATCOMQUOTE;
} else if (this->UseNinjaMulti) {
shellFormat = cmOutputConverter::NINJAMULTI;
}
return this->OutputConverter->ConvertToOutputFormat(input, shellFormat);
}
@@ -117,10 +127,14 @@ std::string cmLinkLineComputer::ConvertToOutputFormat(std::string const& input)
std::string cmLinkLineComputer::ConvertToOutputForExisting(
std::string const& input)
{
cmOutputConverter::OutputFormat shellFormat = (this->ForResponse)
? cmOutputConverter::RESPONSE
: ((this->UseWatcomQuote) ? cmOutputConverter::WATCOMQUOTE
: cmOutputConverter::SHELL);
cmOutputConverter::OutputFormat shellFormat = cmOutputConverter::SHELL;
if (this->ForResponse) {
shellFormat = cmOutputConverter::RESPONSE;
} else if (this->UseWatcomQuote) {
shellFormat = cmOutputConverter::WATCOMQUOTE;
} else if (this->UseNinjaMulti) {
shellFormat = cmOutputConverter::NINJAMULTI;
}
return this->OutputConverter->ConvertToOutputForExisting(input, shellFormat);
}