diff options
author | Brad King <brad.king@kitware.com> | 2020-09-01 13:15:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-01 13:15:39 (GMT) |
commit | f10682b7961c2ad56384641ab141a66f34923753 (patch) | |
tree | 4bf3b7b721dd33b6934faf6c119770bf04209891 /Source/cmLocalGenerator.cxx | |
parent | cd2f894052ea8191e21ec4997b2181c75f637ae9 (diff) | |
parent | 5ece12b7e452acb091300022a392ff71dfce9504 (diff) | |
download | CMake-f10682b7961c2ad56384641ab141a66f34923753.zip CMake-f10682b7961c2ad56384641ab141a66f34923753.tar.gz CMake-f10682b7961c2ad56384641ab141a66f34923753.tar.bz2 |
Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 40010fc..300bb26 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2426,6 +2426,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 = |