cxxmodules: error using check_cxx_source_compiles with clang-cl
using newest cmake 3.28-rc2 and clang-cl 17.0.3 fails for projects, utilizing "check_cxx_source_compiles" with the error message:
CMake Error in C:/gitlab-runner/builds/i2Kez2M3/0/optomet/software/universal/build-clang-cl-debug/CMakeFiles/CMakeScratch/TryCompile-tc4cvj/CMakeLists.txt:
The target named "cmTC_e602a" has C++ sources that may use modules, but the
compiler does not provide a way to discover the import graph dependencies.
See the cmake-cxxmodules(7) manual and the CMAKE_CXX_SCAN_FOR_MODULES
variable.
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.28/Modules/CheckCXXSourceCompiles.cmake:52 (cmake_check_source_compiles)
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6/FindWrapAtomic.cmake:36 (check_cxx_source_compiles)
C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:30 (_qt_internal_find_third_party_dependencies)
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake:41 (include)
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake:156 (find_package)
cmake_gen/oss-qt.cmake:14 (find_package)
cmake_gen/oss-test.cmake:24 (findQt)
CMakeLists.txt:201 (oss_create_test)
CMake Warning at C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake:156 (find_package):
Found package configuration file:
C:/Qt/6.6.0/msvc2019_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
NOT FOUND.
When CMake can't find a suitable compiler, capable of parsing module files, it should only raise a warning and assume that the file does not use modules. If they contain modules, the compiler will fail to compile, since it can't handle the module keywords.