mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
cmSystemTools: Fix IsPathToFramework implementation (#15535)
Use more reliable logic to detect if a path ends in ".framework". The old logic added by commit v2.4.0~791 (add better support for framework linking, 2005-12-26) did not account for paths not ending in it at all. With a 9-character path the logic and "npos == -1" happens to make the old check pass.
This commit is contained in:
@@ -1486,15 +1486,8 @@ void cmSystemTools::EnableVSConsoleOutput()
|
||||
|
||||
bool cmSystemTools::IsPathToFramework(const char* path)
|
||||
{
|
||||
if(cmSystemTools::FileIsFullPath(path))
|
||||
{
|
||||
std::string libname = path;
|
||||
if(libname.find(".framework") == libname.size()+1-sizeof(".framework"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return (cmSystemTools::FileIsFullPath(path) &&
|
||||
cmHasLiteralSuffix(path, ".framework"));
|
||||
}
|
||||
|
||||
bool cmSystemTools::CreateTar(const char* outFileName,
|
||||
|
||||
Reference in New Issue
Block a user