diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-12-10 16:08:24 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-14 13:13:09 -0500 |
commit | c9a50f35565dcc1df8bd82126ecced95e60c29e4 (patch) | |
tree | ede35e80def43d76af7378632f05115c0b43bea7 /Source/cmMakefileTargetGenerator.cxx | |
parent | 6aff058ab4a2d54a316dbaa536572ad71efb8b51 (diff) | |
download | cmake-c9a50f35565dcc1df8bd82126ecced95e60c29e4.tar.gz |
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/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 3776fecc70..c6d6c9946f 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -591,6 +591,11 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( if (lang == "ISPC") { std::string ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(objectName); + ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource); + + cmProp ispcSuffixProp = + this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX"); + assert(ispcSuffixProp != nullptr); std::string directory = this->GeneratorTarget->GetObjectDirectory(config); if (cmProp prop = @@ -598,7 +603,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( directory = cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop); } - ispcHeaderRelative = cmStrCat(directory, '/', ispcSource, ".h"); + ispcHeaderRelative = cmStrCat(directory, '/', ispcSource, *ispcSuffixProp); ispcHeaderForShell = this->LocalGenerator->ConvertToOutputFormat( ispcHeaderRelative, cmOutputConverter::SHELL); } |