diff options
author | Brad King <brad.king@kitware.com> | 2024-05-03 13:26:30 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-05-03 13:26:39 (GMT) |
commit | 1027c0e213a2dc0175c5645fbd9f5989751fae63 (patch) | |
tree | ca79dc323c162214253a958ac7733d0528edd6c7 /Source/cmGeneratorTarget.cxx | |
parent | 1f7cf849c3a6355762f507a81081a6cc1de99ce2 (diff) | |
parent | e89e8193985730fcd7fae61e44bb8c9b3b5ee1af (diff) | |
download | CMake-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.cxx | 19 |
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; } |