diff options
author | Brad King <brad.king@kitware.com> | 2020-12-08 15:16:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-08 15:17:33 (GMT) |
commit | 60d95fe2c2781131a6bdd4e60c22d666d5d84d3a (patch) | |
tree | 6e6213605ac4ab16215208eda0b41d8b3a8abdbc /Source/cmNinjaTargetGenerator.cxx | |
parent | cc14733044d39a6b49775b67ed353e88d4260e9b (diff) | |
parent | 9af93fef11e9ea23d7d87a1c217254c482555262 (diff) | |
download | CMake-60d95fe2c2781131a6bdd4e60c22d666d5d84d3a.zip CMake-60d95fe2c2781131a6bdd4e60c22d666d5d84d3a.tar.gz CMake-60d95fe2c2781131a6bdd4e60c22d666d5d84d3a.tar.bz2 |
Merge topic 'correct_ispc_path_computation'
9af93fef11 ISPC: Handle OBJECT sources in different directories
72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5581
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 6edbf82..838cf4c 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1357,15 +1357,16 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( std::string ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(objectName); - std::string ispcDirectory = objectFileDir; + std::string ispcHeaderDirectory = + this->GeneratorTarget->GetObjectDirectory(config); if (cmProp prop = this->GeneratorTarget->GetProperty("ISPC_HEADER_DIRECTORY")) { - ispcDirectory = *prop; + ispcHeaderDirectory = + cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop); } - ispcDirectory = - cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', ispcDirectory); - std::string ispcHeader = cmStrCat(ispcDirectory, '/', ispcSource, ".h"); + std::string ispcHeader = + cmStrCat(ispcHeaderDirectory, '/', ispcSource, ".h"); ispcHeader = this->ConvertToNinjaPath(ispcHeader); // Make sure ninja knows what command generates the header @@ -1377,8 +1378,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( auto ispcSuffixes = detail::ComputeISPCObjectSuffixes(this->GeneratorTarget); if (ispcSuffixes.size() > 1) { + std::string rootObjectDir = + this->GeneratorTarget->GetObjectDirectory(config); auto ispcSideEfffectObjects = detail::ComputeISPCExtraObjects( - objectName, ispcDirectory, ispcSuffixes); + objectName, rootObjectDir, ispcSuffixes); for (auto sideEffect : ispcSideEfffectObjects) { sideEffect = this->ConvertToNinjaPath(sideEffect); |