summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-12-10 21:08:24 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-14 18:13:09 (GMT)
commitc9a50f35565dcc1df8bd82126ecced95e60c29e4 (patch)
treeede35e80def43d76af7378632f05115c0b43bea7 /Source/cmNinjaTargetGenerator.cxx
parent6aff058ab4a2d54a316dbaa536572ad71efb8b51 (diff)
downloadCMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.zip
CMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.tar.gz
CMake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.tar.bz2
ISPC: Generated Headers suffix configurable with a better default
The target property `ISPC_HEADER_SUFFIX` and associated global variable now can control the suffix used when generating the C/C++ interoperability ISPC headers. In addition the default suffix is now "_ispc.h" which matches the common convention that the ISPC compiler team uses and recommends.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 662399e..d41cbd2 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1374,6 +1374,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
this->GeneratorTarget->GetObjectName(source);
std::string ispcSource =
cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+ ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource);
+
+ cmProp ispcSuffixProp =
+ this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX");
+ assert(ispcSuffixProp != nullptr);
std::string ispcHeaderDirectory =
this->GeneratorTarget->GetObjectDirectory(config);
@@ -1384,7 +1389,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
std::string ispcHeader =
- cmStrCat(ispcHeaderDirectory, '/', ispcSource, ".h");
+ cmStrCat(ispcHeaderDirectory, '/', ispcSource, *ispcSuffixProp);
ispcHeader = this->ConvertToNinjaPath(ispcHeader);
// Make sure ninja knows what command generates the header