summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-03 13:26:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-05-03 13:26:39 (GMT)
commit1027c0e213a2dc0175c5645fbd9f5989751fae63 (patch)
treeca79dc323c162214253a958ac7733d0528edd6c7 /Source/cmGeneratorTarget.cxx
parent1f7cf849c3a6355762f507a81081a6cc1de99ce2 (diff)
parente89e8193985730fcd7fae61e44bb8c9b3b5ee1af (diff)
downloadCMake-1027c0e213a2dc0175c5645fbd9f5989751fae63.zip
CMake-1027c0e213a2dc0175c5645fbd9f5989751fae63.tar.gz
CMake-1027c0e213a2dc0175c5645fbd9f5989751fae63.tar.bz2
Merge topic 'cxxmodules-no-import-std-reason'
e89e819398 Tests/CXXModules: add tests for C++26 `import std` support 6dad18f060 cxxmodules: give a reason for unavailability of `import std` Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9486
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 75f3b6d..c1c0435 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8583,15 +8583,22 @@ bool cmGeneratorTarget::ApplyCXXStdTargets()
continue;
}
- auto const targetName = cmStrCat(
- "__CMAKE::CXX", standardResolver.GetLevelString("CXX", *explicitLevel));
+ auto const stdLevel =
+ standardResolver.GetLevelString("CXX", *explicitLevel);
+ auto const targetName = cmStrCat("__CMAKE::CXX", stdLevel);
if (!this->Makefile->FindTargetToUse(targetName)) {
+ auto basicReason = this->Makefile->GetDefinition(cmStrCat(
+ "CMAKE_CXX", stdLevel, "_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE"));
+ std::string reason;
+ if (!basicReason.IsEmpty()) {
+ reason = cmStrCat(" Reason:\n ", basicReason);
+ }
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
- cmStrCat(
- R"(The "CXX_MODULE_STD" property on the target ")", this->GetName(),
- "\" requires that the \"", targetName,
- "\" target exist, but it was not provided by the toolchain."));
+ cmStrCat(R"(The "CXX_MODULE_STD" property on the target ")",
+ this->GetName(), "\" requires that the \"", targetName,
+ "\" target exist, but it was not provided by the toolchain.",
+ reason));
break;
}