MCPcopy Create free account
hub / github.com/Kitware/CMake / GetStripCommandStyle

Method GetStripCommandStyle

Source/cmGlobalGenerator.cxx:4051–4078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4049}
4050
4051cmGlobalGenerator::StripCommandStyle cmGlobalGenerator::GetStripCommandStyle(
4052 std::string const& strip)
4053{
4054#ifdef __APPLE__
4055 auto i = this->StripCommandStyleMap.find(strip);
4056 if (i == this->StripCommandStyleMap.end()) {
4057 StripCommandStyle style = StripCommandStyle::Default;
4058
4059 // Try running strip tool with Apple-specific options.
4060 std::vector<std::string> cmd{ strip, "-u", "-r" };
4061 std::string out;
4062 std::string err;
4063 int ret;
4064 if (cmSystemTools::RunSingleCommand(cmd, &out, &err, &ret, nullptr,
4065 cmSystemTools::OUTPUT_NONE) &&
4066 // Check for Apple-specific output.
4067 ret != 0 && cmHasLiteralPrefix(err, "fatal error: /") &&
4068 err.find("/usr/bin/strip: no files specified") != std::string::npos) {
4069 style = StripCommandStyle::Apple;
4070 }
4071 i = this->StripCommandStyleMap.emplace(strip, style).first;
4072 }
4073 return i->second;
4074#else
4075 static_cast<void>(strip);
4076 return StripCommandStyle::Default;
4077#endif
4078}
4079
4080std::string cmGlobalGenerator::GetEncodedLiteral(std::string const& lit)
4081{

Callers 1

AddStripRuleMethod · 0.80

Calls 4

cmHasLiteralPrefixFunction · 0.85
emplaceMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected