There was an issue on GitHub, but it is still open :
Proposal: Support compiling projects with Clang #1156
You can upvote/add a comment to draw attention to MS people...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, When I create a WinUI project in Visual Studio, below is how the project structure looks like:
This project by default gets built using MSBuild as build system and default MSVS compiler.
However, I would like to build this project using MSBuild as build system and Visual Studio' LLVM toolset for compilation and linker.
Is this possible to achieve?
This is how I am trying.
D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master>cmake -S . -G "Visual Studio 17 2022" -T ClangCL
-- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The C compiler identification is Clang 15.0.1 with MSVC-like command-line
-- The CXX compiler identification is Clang 15.0.1 with MSVC-like command-line
And this automatically picks VS's LLVM's clang-cl.exe as compilerD:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master>cmake --build .
It fails with below error D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src/App.xaml.h(4,10): fatal error : '
App.xaml.g.h
' file not found [D:\Wi nUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src\DemoApp.vcxproj] D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src\MainWindow.xaml.cpp(9,3): error : use of undeclared identifier 'Initi alizeComponent' [D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src\DemoApp.vcxproj] D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src\MainWindow.xaml.cpp(15,12): error : function 'IsSettingsInvoked' with deduced return type cannot be used before it is defined [D:\WinUI\cmake-cpp-winrt-winui3-master_LLVMclang-cl\cmake-cpp-winrt-winui3-master\src\DemoApp.vcx proj]
It seems MSBuild process did not generate App.xaml.g.h/App.xaml.g.xpp (and many more files that gets generated if we use MSVC Compiler )) which means that MSBuild did not run the xamlCompiler task to generate .g.h and g.cpp files.
Is there anything specific need to be done to resolve this issue? Am I missing something here?
Any pointers/suggestions will help.
There was an issue on GitHub, but it is still open :
Proposal: Support compiling projects with Clang #1156
You can upvote/add a comment to draw attention to MS people...