An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit ea8dc076 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

ENH: Only mangle object files if CMAKE_MANGLE_OBJECT_FILE_NAMES is set. Only on borland for now.

parent 1f6e59a7
......@@ -21,6 +21,8 @@ SET(BORLAND 1)
#SET(CMAKE_END_TEMP_FILE "")
#SET(CMAKE_VERBOSE_MAKEFILE 1)
# Borland cannot handle + in the file name, so mangle object file name
SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
# create a shared C++ library
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
......
......@@ -3077,38 +3077,45 @@ std::string cmLocalUnixMakefileGenerator::LowerCasePath(const char* path)
std::string&
cmLocalUnixMakefileGenerator::CreateSafeUniqueObjectFileName(const char* sin)
{
std::map<cmStdString,cmStdString>::iterator it = m_UniqueObjectNamesMap.find(sin);
if ( it == m_UniqueObjectNamesMap.end() )
{
std::string ssin = sin;
bool done;
int cc = 0;
char rpstr[100];
sprintf(rpstr, "_p_");
cmSystemTools::ReplaceString(ssin, "+", rpstr);
std::string sssin = sin;
do
{
done = true;
for ( it = m_UniqueObjectNamesMap.begin();
it != m_UniqueObjectNamesMap.end();
++ it )
if ( m_Makefile->IsOn("CMAKE_MANGLE_OBJECT_FILE_NAMES") )
{
std::map<cmStdString,cmStdString>::iterator it = m_UniqueObjectNamesMap.find(sin);
if ( it == m_UniqueObjectNamesMap.end() )
{
std::string ssin = sin;
bool done;
int cc = 0;
char rpstr[100];
sprintf(rpstr, "_p_");
cmSystemTools::ReplaceString(ssin, "+", rpstr);
std::string sssin = sin;
do
{
if ( it->second == ssin )
done = true;
for ( it = m_UniqueObjectNamesMap.begin();
it != m_UniqueObjectNamesMap.end();
++ it )
{
done = false;
if ( it->second == ssin )
{
done = false;
}
}
if ( done )
{
break;
}
sssin = ssin;
cmSystemTools::ReplaceString(ssin, "_p_", rpstr);
sprintf(rpstr, "_p%d_", cc++);
}
if ( done )
{
break;
}
sssin = ssin;
cmSystemTools::ReplaceString(ssin, "_p_", rpstr);
sprintf(rpstr, "_p%d_", cc++);
while ( !done );
m_UniqueObjectNamesMap[sin] = ssin;
}
while ( !done );
m_UniqueObjectNamesMap[sin] = ssin;
}
else
{
m_UniqueObjectNamesMap[sin] = sin;
}
return m_UniqueObjectNamesMap[sin];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment