[CMake] Is there any way to use clang-cl with MSBuild on Windows?

Yi-Hong Lyu b95705030 at ntu.edu.tw
Sun Jan 31 13:47:58 EST 2016


Hello Bill,

If I generate the ALL_BUILD.vcxproj for MSVC 19.0.23506.0 as usual, I can
use command "msbuild ALL_BUILD.vcxproj /p:cltoolexe=clang-cl" to build the
project using clang-cl. However it might include wrong directory like
C:\\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt during
building when I build library libcxx. Is there any way to overwrite
variables such as ExcludePath, IncludePath, UniversalCRT_IncludePath and
VC_IncludePath?

Hello Nicholas,

Which value should I put for -T parameter?

BTW, is CMAKE_TOOLCHAIN_FILE able to used in this situation?

Thanks

2016-01-30 8:33 GMT+08:00 Nicholas Braden <nicholas11braden at gmail.com>:

> Have you tried setting the toolset? The -T parameter can set the
> toolset. This sets the platform toolset property that you would
> normally set in Visual Studio. if Visual Studio lets you select the
> llvm platform toolset, so will CMake.
>
> On Fri, Jan 29, 2016 at 12:04 PM, Yi-Hong Lyu <b95705030 at ntu.edu.tw>
> wrote:
> > Hello everyone,
> >
> > I am a newbie of CMake. I would like to use clang-cl with MSBuild on
> > Windows. However it always use MSVC 19.0.23506.0 as the identified
> compiler
> > even I defined CMAKE_C_COMPILER / CMAKE_CXX_COMPILER /
> > CMAKE_C_COMPILER_FORCED / CMAKE_CXX_COMPILER_FORCED:
> >
> > $ cmake -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
> > -DCMAKE_C_COMPILER_FORCED=ON -DCMAKE_CXX_COMPILER_FORCED=ON ..\src\
> > -- Building for: Visual Studio 14 2015
> > -- The CXX compiler identification is MSVC 19.0.23506.0
> > -- The C compiler identification is MSVC 19.0.23506.0
> > -- Configuring for standalone build.
> > -- Found PythonInterp: C:/Python34/python.exe (found version "3.4.4")
> > -- Sphinx disabled.
> > .
> > .
> > .
> >
> > PS. The environment PATH is already set to clang-cl.
> >
> > I am wondering whether there is any option that I can force MSBuild use
> > clang-cl instead.
> >
> > Thanks,
> > Yi-Hong
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> > information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160201/3b13c1db/attachment.html>


More information about the CMake mailing list