Fix Xcode dylib version default
The commit "Set version info for shared libs on OSX" taught the Xcode generator to honor VERSION and SOVERSION properties. However, it also set version '1.0.0' as the default when no version property is set, which is inconsistent with the Makefiles generator. This commit fixes the default to '0.0.0' for consistency. See issue #9773.
This commit is contained in:
parent
99697308f3
commit
7b28fbd656
|
@ -1865,25 +1865,25 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||
|
||||
// VERSION -> current_version
|
||||
target.GetTargetVersion(false, major, minor, patch);
|
||||
if(major == 0 && minor == 0 && patch == 0)
|
||||
{
|
||||
// Xcode always wants at least 1.0.0
|
||||
major = 1;
|
||||
}
|
||||
cmOStringStream v;
|
||||
v << major << "." << minor << "." << patch;
|
||||
|
||||
// Xcode always wants at least 1.0.0 or nothing
|
||||
if(!(major == 0 && minor == 0 && patch == 0))
|
||||
{
|
||||
v << major << "." << minor << "." << patch;
|
||||
}
|
||||
buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
|
||||
this->CreateString(v.str().c_str()));
|
||||
|
||||
// SOVERSION -> compatibility_version
|
||||
target.GetTargetVersion(true, major, minor, patch);
|
||||
if(major == 0 && minor == 0 && patch == 0)
|
||||
{
|
||||
// Xcode always wants at least 1.0.0
|
||||
major = 1;
|
||||
}
|
||||
cmOStringStream vso;
|
||||
vso << major << "." << minor << "." << patch;
|
||||
|
||||
// Xcode always wants at least 1.0.0 or nothing
|
||||
if(!(major == 0 && minor == 0 && patch == 0))
|
||||
{
|
||||
vso << major << "." << minor << "." << patch;
|
||||
}
|
||||
buildSettings->AddAttribute("DYLIB_COMPATIBILITY_VERSION",
|
||||
this->CreateString(vso.str().c_str()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue