cmake-conan icon indicating copy to clipboard operation
cmake-conan copied to clipboard

Failure when using clang-cl toolset with MSVC 2019

Open Malacath-92 opened this issue 5 years ago • 3 comments

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.

Malacath-92 avatar Mar 05 '20 19:03 Malacath-92

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

czoido avatar Mar 11 '20 17:03 czoido

I am still getting this exact error, even though the referenced ticket - conan-io/conan#5705 - says it's fixed and merged...

claremacrae avatar Apr 03 '21 17:04 claremacrae

An example failed build is https://github.com/claremacrae/ApprovalTests.cpp.Demos/runs/2260661615?check_suite_focus=true

claremacrae avatar Apr 03 '21 17:04 claremacrae