diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-05-04 15:24:32 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-05-04 15:24:32 (GMT) |
commit | ea8dc0769d58b6e713f140416215a038655cbb5d (patch) | |
tree | fee192cf3eca9eccdf62a614d4e5c53762fa954a /Source/cmLocalUnixMakefileGenerator.cxx | |
parent | 1f6e59a7fea67b1e231309587a4db7cb5c8efcad (diff) | |
download | CMake-ea8dc0769d58b6e713f140416215a038655cbb5d.zip CMake-ea8dc0769d58b6e713f140416215a038655cbb5d.tar.gz CMake-ea8dc0769d58b6e713f140416215a038655cbb5d.tar.bz2 |
ENH: Only mangle object files if CMAKE_MANGLE_OBJECT_FILE_NAMES is set. Only on borland for now.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 34de3ca..f7bd1bb 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -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]; } |