summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-20 14:39:16 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-20 14:41:41 (GMT)
commit5da2c7116577dd6407e6093992021cfd972ce08e (patch)
tree1fa6f4a38a0d223d8bd1556b03ca8d6622e5acb2 /Source
parentd421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff)
downloadCMake-5da2c7116577dd6407e6093992021cfd972ce08e.zip
CMake-5da2c7116577dd6407e6093992021cfd972ce08e.tar.gz
CMake-5da2c7116577dd6407e6093992021cfd972ce08e.tar.bz2
GHS: Fix crash when GHS_NO_SOURCE_GROUP_FILE property is not defined
Refactoring in commit 36aba01223 (cmGeneratorTarget::GetProperty: return cmProp, 2020-04-29, v3.18.0-rc1~246^2) left out a `nullptr` check. Fixes: #20985
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 358d65a..97580d6 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -550,8 +550,9 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
*/
for (auto& sg : groupFilesList) {
std::ostream* fout;
- bool useProjectFile = cmIsOn(*this->GeneratorTarget->GetProperty(
- "GHS_NO_SOURCE_GROUP_FILE")) ||
+ cmProp noSourceGroupFile =
+ this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE");
+ bool useProjectFile = (noSourceGroupFile && cmIsOn(*noSourceGroupFile)) ||
cmIsOn(this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
if (useProjectFile || sg.empty()) {
fout = &fout_proj;