summaryrefslogtreecommitdiffstats
path: root/Source/cmGhsMultiTargetGenerator.cxx
diff options
context:
space:
mode:
authorGeoff Viola <geoffrey.viola@asirobots.com>2016-05-15 15:59:43 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-18 13:27:19 (GMT)
commitd7233a0472aae1f15f4c35f214294d9baf1b5e1f (patch)
treeb5a1e61dedddec3abbe8ae88b32df4fb23bd280f /Source/cmGhsMultiTargetGenerator.cxx
parent7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (diff)
downloadCMake-d7233a0472aae1f15f4c35f214294d9baf1b5e1f.zip
CMake-d7233a0472aae1f15f4c35f214294d9baf1b5e1f.tar.gz
CMake-d7233a0472aae1f15f4c35f214294d9baf1b5e1f.tar.bz2
GHS: Use shorter object file names on collision
Diffstat (limited to 'Source/cmGhsMultiTargetGenerator.cxx')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 325a86e..5e13d4c 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -18,7 +18,6 @@
#include "cmSourceFile.h"
#include "cmTarget.h"
#include <assert.h>
-#include <cmAlgorithms.h>
std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
@@ -466,20 +465,14 @@ cmGhsMultiTargetGenerator::GetObjectNames(
for (std::vector<cmSourceFile*>::const_iterator sf =
duplicateSources.begin();
sf != duplicateSources.end(); ++sf) {
- static std::string::size_type const MAX_FULL_PATH_LENGTH = 247;
std::string const longestObjectDirectory(
cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
localGhsMultiGenerator, generatorTarget, *sf));
- std::string fullFilename = (*sf)->GetFullPath();
- bool const ObjPathFound = cmLocalGeneratorCheckObjectName(
- fullFilename, longestObjectDirectory.size(), MAX_FULL_PATH_LENGTH);
- if (!ObjPathFound) {
- cmSystemTools::Error("Object path \"", fullFilename.c_str(),
- "\" too long", "");
- }
- cmsys::SystemTools::ReplaceString(fullFilename, ":/", "_");
- cmsys::SystemTools::ReplaceString(fullFilename, "/", "_");
- objectNamesCorrected[*sf] = fullFilename;
+ std::string objFilenameName =
+ localGhsMultiGenerator->GetObjectFileNameWithoutTarget(
+ **sf, longestObjectDirectory);
+ cmsys::SystemTools::ReplaceString(objFilenameName, "/", "_");
+ objectNamesCorrected[*sf] = objFilenameName;
}
return objectNamesCorrected;
@@ -517,8 +510,7 @@ void cmGhsMultiTargetGenerator::WriteSources(
this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
if (objectNames.end() != objectNames.find(*si)) {
*this->FolderBuildStreams[sgPath]
- << " -o \"" << objectNames.find(*si)->second << ".o\""
- << std::endl;
+ << " -o \"" << objectNames.find(*si)->second << "\"" << std::endl;
}
this->WriteObjectDir(this->FolderBuildStreams[sgPath],