diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-12-07 14:14:13 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-12-07 14:14:13 (GMT) |
commit | 72ae15ebcb6061623b8a4a7119ddb49154e83094 (patch) | |
tree | 36bf6ea783a97a54ce191f884dc730bfe4e7a029 /Source/cmNinjaTargetGenerator.cxx | |
parent | 64fb825438a2fecb9eab9933d5d1b926bf6f294b (diff) | |
download | CMake-72ae15ebcb6061623b8a4a7119ddb49154e83094.zip CMake-72ae15ebcb6061623b8a4a7119ddb49154e83094.tar.gz CMake-72ae15ebcb6061623b8a4a7119ddb49154e83094.tar.bz2 |
ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location
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 76df9f2..662399e 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1375,15 +1375,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 @@ -1395,8 +1396,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); |