On Mon, Feb 8, 2016 at 1:56 PM, Victor Leschuk <[email protected]> wrote:
> Hello, I am trying to use clang with cmake on Windows.
>
> I have compiled LLVM+clang using Visual Studio 2015. And now I am facing
> problems with building cmake projects using this clang. It looks like cmake
> is trying to pass wrong options to linker.
>
> os: Windows 7 (64bit)
>
> $ clang --version
> clang version 3.9.0
> Target: i686-pc-windows-msvc
> Thread model: posix
>
> $ cmake --version
> cmake version 3.5.0-rc1
>
> It would be great if someone could point me to what am I doing wrong?
>
> Thanks in advance!
>
Did you build also libc++? Which CRT does clang 3.9.0 use on Windows?
Clang officially offers the clang-cl driver, which is a Visual C++ cl.exe
replacement.
The following works with Clang 3.7.0 and Visual C++ 2013 (should also work
with Clang 3.9 and Visual C++ 2015):
1. Open Visual C++ command prompt window
2. Set INCLUDE and PATH to the clang-cl
set PATH=C:\Program Files (x86)\LLVM\msbuild-bin\;%PATH%
set INCLUDE=C:\Program Files
(x86)\LLVM\lib\clang\3.7.0\include\;%INCLUDE%
3. cmake -G "Ninja" will pick clang-cl and should build and link just fine.
HTH,
Cristian
--
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