cmake-conan
cmake-conan copied to clipboard
Failure when using clang-cl toolset with MSVC 2019
With Visual Studio 2019 installed running
cmake ../.. -A x64 -T ClangCL
to use the clang-cl toolset I get an error within conan.cmake when it runs conan_cmake_detect_unix_libcxx, which I don't think it should run when creating a solution for MSVC:
Microsoft (R) C/C++ Optimizing Compiler Version 19.25.28610.4 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '-x'
cl : Command line warning D9002 : ignoring unknown option '-dM'
cl : Command line warning D9002 : ignoring unknown option '-'
c++
c1: fatal error C1083: Cannot open source file: 'c++': No such file or directory
For me it works to replace line 170 with if (USING_CXX AND NOT MSVC) but I doubt that is a good fix.
Hi @Malacath-92, Thanks for reporting. Currently cmake conan and conan do not fully support clang-cl but we are in have some work in progress: https://github.com/conan-io/conan/pull/5705
I am still getting this exact error, even though the referenced ticket - conan-io/conan#5705 - says it's fixed and merged...
An example failed build is https://github.com/claremacrae/ApprovalTests.cpp.Demos/runs/2260661615?check_suite_focus=true