| 240 | } |
| 241 | |
| 242 | std::string cmOutputConverter::EscapeForShell(cm::string_view str, |
| 243 | bool makeVars, bool forEcho, |
| 244 | bool useWatcomQuote, |
| 245 | bool unescapeNinjaConfiguration, |
| 246 | bool forResponse) const |
| 247 | { |
| 248 | // Compute the flags for the target shell environment. |
| 249 | int flags = 0; |
| 250 | if (this->GetState()->UseWindowsVSIDE()) { |
| 251 | flags |= Shell_Flag_VSIDE; |
| 252 | } else if (!this->LinkScriptShell) { |
| 253 | flags |= Shell_Flag_Make; |
| 254 | } |
| 255 | if (unescapeNinjaConfiguration) { |
| 256 | flags |= Shell_Flag_UnescapeNinjaConfiguration; |
| 257 | } |
| 258 | if (makeVars) { |
| 259 | flags |= Shell_Flag_AllowMakeVariables; |
| 260 | } |
| 261 | if (forEcho) { |
| 262 | flags |= Shell_Flag_EchoWindows; |
| 263 | } |
| 264 | if (useWatcomQuote) { |
| 265 | flags |= Shell_Flag_WatcomQuote; |
| 266 | } |
| 267 | if (forResponse) { |
| 268 | flags |= Shell_Flag_IsResponse; |
| 269 | } |
| 270 | if (this->GetState()->UseWatcomWMake()) { |
| 271 | flags |= Shell_Flag_WatcomWMake; |
| 272 | } |
| 273 | if (this->GetState()->UseMinGWMake()) { |
| 274 | flags |= Shell_Flag_MinGWMake; |
| 275 | } |
| 276 | if (this->GetState()->UseNMake()) { |
| 277 | flags |= Shell_Flag_NMake; |
| 278 | } |
| 279 | if (this->GetState()->UseNinja()) { |
| 280 | flags |= Shell_Flag_Ninja; |
| 281 | } |
| 282 | if (!this->GetState()->UseWindowsShell()) { |
| 283 | flags |= Shell_Flag_IsUnix; |
| 284 | } |
| 285 | if (this->GetState()->UseFastbuildMake()) { |
| 286 | // Fastbuild needs to escape very few characters. |
| 287 | flags = Shell_Flag_Fastbuild; |
| 288 | } |
| 289 | |
| 290 | return cmOutputConverter::EscapeForShell(str, flags); |
| 291 | } |
| 292 | |
| 293 | std::string cmOutputConverter::EscapeForShell(cm::string_view str, int flags) |
| 294 | { |
no test coverage detected