summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-06-30 14:13:53 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-08-28 15:21:31 (GMT)
commite783bf8aa6f90ddb1458c7b1a78c5d0225c1496a (patch)
treeb59fe2e01365d0ec14d79f38be8bede5afde6a62 /Source/cmLocalGenerator.cxx
parent34cc6acc81758e29f8c88607c21ab11d8807f87c (diff)
downloadCMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.zip
CMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.tar.gz
CMake-e783bf8aa6f90ddb1458c7b1a78c5d0225c1496a.tar.bz2
ISPC: Support ISPC header generation byproducts and parallel builds
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7e35fe7..9369bd4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2408,6 +2408,38 @@ void cmLocalGenerator::AppendFlagEscape(std::string& flags,
this->EscapeForShell(rawFlag, false, false, false, this->IsNinjaMulti()));
}
+void cmLocalGenerator::AddISPCDependencies(cmGeneratorTarget* target)
+{
+ //
+ std::vector<std::string> configsList =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ for (std::string const& config : configsList) {
+
+ std::string perConfigDir = target->GetObjectDirectory(config);
+ if (cmProp prop = target->GetProperty("ISPC_HEADER_DIRECTORY")) {
+ perConfigDir = cmSystemTools::CollapseFullPath(
+ cmStrCat(this->GetBinaryDirectory(), '/', *prop));
+ }
+
+ std::vector<cmSourceFile*> sources;
+ target->GetSourceFiles(sources, config);
+
+ // build up the list of ispc headers that this target is generating
+ for (cmSourceFile const* sf : sources) {
+ // Generate this object file's rule file.
+ const std::string& lang = sf->GetLanguage();
+ if (lang == "ISPC") {
+ std::string const& objectName = target->GetObjectName(sf);
+ std::string ispcSource =
+ cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+
+ auto headerPath = cmStrCat(perConfigDir, '/', ispcSource, ".h");
+ target->AddISPCGeneratedHeader(headerPath, config);
+ }
+ }
+ }
+}
+
void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
{
std::vector<std::string> configsList =