bug: fix same path comparison when short paths are used
This commit is contained in:
parent
f901b9c340
commit
ed50410ae7
@ -549,7 +549,18 @@ void cmNMakeMakefileGenerator::OutputIncludeMakefile(std::ostream& fout,
|
|||||||
fout << "!include " << file << "\n";
|
fout << "!include " << file << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmNMakeMakefileGenerator::SamePath(const char* path1, const char* path2)
|
||||||
|
{
|
||||||
|
// first check to see if they are the same anyway
|
||||||
|
if (strcmp(path1, path2) == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// next short path and lower case both of them for the compare
|
||||||
|
return
|
||||||
|
cmSystemTools::LowerCase(ShortPath(path1)) ==
|
||||||
|
cmSystemTools::LowerCase(ShortPath(path2));
|
||||||
|
}
|
||||||
|
|
||||||
void cmNMakeMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout,
|
void cmNMakeMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout,
|
||||||
const char* path,
|
const char* path,
|
||||||
|
@ -103,7 +103,9 @@ protected:
|
|||||||
virtual void OutputBuildLibraryInDir(std::ostream& fout,
|
virtual void OutputBuildLibraryInDir(std::ostream& fout,
|
||||||
const char* path,
|
const char* path,
|
||||||
const char* library,
|
const char* library,
|
||||||
const char* fullpath);
|
const char* fullpath);
|
||||||
|
///! return true if the two paths are the same (checks short paths)
|
||||||
|
virtual bool SamePath(const char* path1, const char* path2);
|
||||||
private:
|
private:
|
||||||
bool m_QuoteNextCommand; // if this is true, OutputMakeRule
|
bool m_QuoteNextCommand; // if this is true, OutputMakeRule
|
||||||
// will not quote the next commands
|
// will not quote the next commands
|
||||||
|
@ -762,8 +762,8 @@ void cmUnixMakefileGenerator::OutputDependLibs(std::ostream& fout)
|
|||||||
const char* cacheValue = m_Makefile->GetDefinition(lib->c_str());
|
const char* cacheValue = m_Makefile->GetDefinition(lib->c_str());
|
||||||
// if cache and not the current directory add a rule, to
|
// if cache and not the current directory add a rule, to
|
||||||
// jump into the directory and build for the first time
|
// jump into the directory and build for the first time
|
||||||
if(cacheValue
|
if(cacheValue &&
|
||||||
&& (strcmp(m_Makefile->GetCurrentOutputDirectory(), cacheValue) != 0))
|
(!this->SamePath(m_Makefile->GetCurrentOutputDirectory(), cacheValue)))
|
||||||
{
|
{
|
||||||
std::string library = m_LibraryPrefix;
|
std::string library = m_LibraryPrefix;
|
||||||
library += *lib;
|
library += *lib;
|
||||||
@ -811,6 +811,12 @@ void cmUnixMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout,
|
|||||||
<< ":\n\tcd " << cmSystemTools::EscapeSpaces(path)
|
<< ":\n\tcd " << cmSystemTools::EscapeSpaces(path)
|
||||||
<< "; $(MAKE) " << fullpath << "\n\n";
|
<< "; $(MAKE) " << fullpath << "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmUnixMakefileGenerator::SamePath(const char* path1, const char* path2)
|
||||||
|
{
|
||||||
|
return strcmp(path1, path2) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
void cmUnixMakefileGenerator::OutputLibDepend(std::ostream& fout,
|
void cmUnixMakefileGenerator::OutputLibDepend(std::ostream& fout,
|
||||||
const char* name)
|
const char* name)
|
||||||
{
|
{
|
||||||
@ -820,7 +826,7 @@ void cmUnixMakefileGenerator::OutputLibDepend(std::ostream& fout,
|
|||||||
// if there is a cache value, then this is a library that cmake
|
// if there is a cache value, then this is a library that cmake
|
||||||
// knows how to build, so we can depend on it
|
// knows how to build, so we can depend on it
|
||||||
std::string libpath;
|
std::string libpath;
|
||||||
if (strcmp(m_Makefile->GetCurrentOutputDirectory(), cacheValue) != 0)
|
if (!this->SamePath(m_Makefile->GetCurrentOutputDirectory(), cacheValue))
|
||||||
{
|
{
|
||||||
// if the library is not in the current directory, then get the full
|
// if the library is not in the current directory, then get the full
|
||||||
// path to it
|
// path to it
|
||||||
|
@ -155,6 +155,8 @@ protected:
|
|||||||
const char* path,
|
const char* path,
|
||||||
const char* library,
|
const char* library,
|
||||||
const char* fullpath);
|
const char* fullpath);
|
||||||
|
///! return true if the two paths are the same
|
||||||
|
virtual bool SamePath(const char* path1, const char* path2);
|
||||||
virtual std::string GetOutputExtension(const char* sourceExtension);
|
virtual std::string GetOutputExtension(const char* sourceExtension);
|
||||||
virtual void OutputIncludeMakefile(std::ostream&, const char* file);
|
virtual void OutputIncludeMakefile(std::ostream&, const char* file);
|
||||||
void SetObjectFileExtension(const char* e) { m_ObjectFileExtension = e;}
|
void SetObjectFileExtension(const char* e) { m_ObjectFileExtension = e;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user