summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-12-07 14:14:54 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-12-07 14:14:54 (GMT)
commit9af93fef11e9ea23d7d87a1c217254c482555262 (patch)
tree4a728838b1784604c14464187db7675fcfcad34a /Source/cmGeneratorTarget.cxx
parent72ae15ebcb6061623b8a4a7119ddb49154e83094 (diff)
downloadCMake-9af93fef11e9ea23d7d87a1c217254c482555262.zip
CMake-9af93fef11e9ea23d7d87a1c217254c482555262.tar.gz
CMake-9af93fef11e9ea23d7d87a1c217254c482555262.tar.bz2
ISPC: Handle OBJECT sources in different directories
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e735897..c299dad 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5107,9 +5107,14 @@ void cmGeneratorTarget::GetTargetObjectNames(
objects.push_back(map_it->second);
}
+ // We need to compute the relative path from the root of
+ // of the object directory to handle subdirectory paths
+ std::string rootObjectDir = this->GetObjectDirectory(config);
+ rootObjectDir = cmSystemTools::CollapseFullPath(rootObjectDir);
auto ispcObjects = this->GetGeneratedISPCObjects(config);
for (std::string const& output : ispcObjects) {
- objects.push_back(cmSystemTools::GetFilenameName(output));
+ auto relativePathFromObjectDir = output.substr(rootObjectDir.size());
+ objects.push_back(relativePathFromObjectDir);
}
}