Getting an error building qt6.3.3 open source

The EXCLUDE_FROM_ALL property of target “qtdiag” varies by configuration.
This is not supported by the “Visual Studio 17 2022” generator.

Is there a way to work around this?

The docs for the property state:

So it is known to not be supported today. I’m not sure what would be required to support it in the Visual Studio or Xcode generators.