Visual Studio 安装程序在 VS 2019 中安装的 LLVM 的平台工具集名称是什么?
What is the Platform Toolset name of LLVM installed by Visual Studio Installer in VS 2019?
我正在尝试从 cmake 命令行调用 Visual Studio 安装程序安装的 "Clang compiler for Windows"。根据 opned .sln
文件的平台工具集,这应该是 clang-cl
,但是将 cmake 的 -T
标志设置为 clang-cl
和 LLVM
都不起作用。
What is the Platform Toolset name of LLVM installed by Visual Studio
Installer in VS 2019?
对于您的情况,您不能使用“-T”来调用 clang-cl
,并且它不在受支持的工具集中。可以直接使用DCMAKE_CXX_COMPILER
。
-T Toolset specification for the generator, if supported.
Some CMake generators support a toolset specification to tell the
native build system how to choose a compiler. See the
CMAKE_GENERATOR_TOOLSET variable for details.
解决方案
请试试这个:
cmake -G "Visual Studio 16 2019" -DCMAKE_CXX_COMPILER=clang-cl -p "CMakeLists.txt"
更多信息可以参考。
更新 1
可以用-T
实现,用clangcl
代替clang-cl
。在工具集中,LLVM 被称为 clangcl
.
cmake -G "Visual Studio 16 2019" -T clangcl
希望对您有所帮助。
我正在尝试从 cmake 命令行调用 Visual Studio 安装程序安装的 "Clang compiler for Windows"。根据 opned .sln
文件的平台工具集,这应该是 clang-cl
,但是将 cmake 的 -T
标志设置为 clang-cl
和 LLVM
都不起作用。
What is the Platform Toolset name of LLVM installed by Visual Studio Installer in VS 2019?
对于您的情况,您不能使用“-T”来调用 clang-cl
,并且它不在受支持的工具集中。可以直接使用DCMAKE_CXX_COMPILER
。
-T Toolset specification for the generator, if supported.
Some CMake generators support a toolset specification to tell the native build system how to choose a compiler. See the CMAKE_GENERATOR_TOOLSET variable for details.
解决方案
请试试这个:
cmake -G "Visual Studio 16 2019" -DCMAKE_CXX_COMPILER=clang-cl -p "CMakeLists.txt"
更多信息可以参考
更新 1
可以用-T
实现,用clangcl
代替clang-cl
。在工具集中,LLVM 被称为 clangcl
.
cmake -G "Visual Studio 16 2019" -T clangcl
希望对您有所帮助。