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

Method AppendOSXVerFlag

Source/cmCommonTargetGenerator.cxx:305–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
306 std::string const& lang,
307 char const* name, bool so)
308{
309 // Lookup the flag to specify the version.
310 std::string fvar = cmStrCat("CMAKE_", lang, "_OSX_", name, "_VERSION_FLAG");
311 cmValue flag = this->Makefile->GetDefinition(fvar);
312
313 // Skip if no such flag.
314 if (!flag) {
315 return;
316 }
317
318 // Lookup the target version information.
319 int major;
320 int minor;
321 int patch;
322 std::string prop = cmStrCat("MACHO_", name, "_VERSION");
323 std::string fallback_prop = so ? "SOVERSION" : "VERSION";
324 this->GeneratorTarget->GetTargetVersionFallback(prop, fallback_prop, major,
325 minor, patch);
326 if (major > 0 || minor > 0 || patch > 0) {
327 // Append the flag since a non-zero version is specified.
328 std::ostringstream vflag;
329 vflag << *flag << major << "." << minor << "." << patch;
330 this->LocalCommonGenerator->AppendFlags(flags, vflag.str());
331 }
332}
333
334std::string cmCommonTargetGenerator::GetCompilerLauncher(
335 std::string const& lang, std::string const& config)

Callers 3

WriteLibraryRulesMethod · 0.80
WriteLinkStatementMethod · 0.80

Calls 5

strMethod · 0.80
cmStrCatFunction · 0.70
GetDefinitionMethod · 0.45
AppendFlagsMethod · 0.45

Tested by

no test coverage detected