---------------------------------------------------------------------------- This function strips off Xcode attributes that do not target the current configuration
| 2340 | // This function strips off Xcode attributes that do not target the current |
| 2341 | // configuration |
| 2342 | void cmGlobalXCodeGenerator::FilterConfigurationAttribute( |
| 2343 | std::string const& configName, std::string& attribute) |
| 2344 | { |
| 2345 | // Handle [variant=<config>] condition explicitly here. |
| 2346 | std::string::size_type beginVariant = attribute.find("[variant="); |
| 2347 | if (beginVariant == std::string::npos) { |
| 2348 | // There is no variant in this attribute. |
| 2349 | return; |
| 2350 | } |
| 2351 | |
| 2352 | std::string::size_type endVariant = attribute.find(']', beginVariant + 9); |
| 2353 | if (endVariant == std::string::npos) { |
| 2354 | // There is no terminating bracket. |
| 2355 | return; |
| 2356 | } |
| 2357 | |
| 2358 | // Compare the variant to the configuration. |
| 2359 | std::string variant = |
| 2360 | attribute.substr(beginVariant + 9, endVariant - beginVariant - 9); |
| 2361 | if (variant == configName) { |
| 2362 | // The variant matches the configuration so use this |
| 2363 | // attribute but drop the [variant=<config>] condition. |
| 2364 | attribute.erase(beginVariant, endVariant - beginVariant + 1); |
| 2365 | } else { |
| 2366 | // The variant does not match the configuration so |
| 2367 | // do not use this attribute. |
| 2368 | attribute.clear(); |
| 2369 | } |
| 2370 | } |
| 2371 | |
| 2372 | void cmGlobalXCodeGenerator::AddCommandsToBuildPhase( |
| 2373 | cmXCodeObject* buildphase, cmGeneratorTarget* target, |
no test coverage detected