cmGeneratorTarget: support better errors when checking for C++20 modules

Some callers have their own error reporting mechanisms which give more
context. Support handing off the error string for these use cases.
This commit is contained in:
Ben Boeckel
2023-07-23 13:36:53 -04:00
parent 58d27dc6db
commit 1690e451f7
2 changed files with 23 additions and 16 deletions

View File

@@ -1264,8 +1264,11 @@ public:
*
* This will inspect the target itself to see if C++20 module
* support is expected to work based on its sources.
*
* If `errorMessage` is given a non-`nullptr`, any error message will be
* stored in it, otherwise the error will be reported directly.
*/
bool HaveCxx20ModuleSources() const;
bool HaveCxx20ModuleSources(std::string* errorMessage = nullptr) const;
enum class Cxx20SupportLevel
{