MCPcopy Index your code
hub / github.com/Kitware/CMake / FilterConfigurationAttribute

Method FilterConfigurationAttribute

Source/cmGlobalXCodeGenerator.cxx:2342–2370  ·  view source on GitHub ↗

---------------------------------------------------------------------------- This function strips off Xcode attributes that do not target the current configuration

Source from the content-addressed store, hash-verified

2340// This function strips off Xcode attributes that do not target the current
2341// configuration
2342void 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
2372void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
2373 cmXCodeObject* buildphase, cmGeneratorTarget* target,

Callers 2

CreateBuildSettingsMethod · 0.95
CreateXCodeObjectsMethod · 0.95

Calls 4

eraseMethod · 0.80
findMethod · 0.45
substrMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected