Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang via Visual Studio results in error #2285

Closed
3 tasks done
mpdelbuono opened this issue Jan 9, 2018 · 4 comments
Closed
3 tasks done

Clang via Visual Studio results in error #2285

mpdelbuono opened this issue Jan 9, 2018 · 4 comments
Assignees
Milestone

Comments

@mpdelbuono
Copy link
Contributor

mpdelbuono commented Jan 9, 2018

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.

Conan 0.30.3

When using the compiler to Visual Studio and compiler.toolset setting set to LLVM-vs2014 (and possibly others), the CMake generator's generated file creates an error condition:

-- Selecting Windows SDK version 10.0.15063.0 to target Windows 6.1.7601.
-- The C compiler identification is Clang 5.0.1
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe
-- Check for working C compiler: C:/Program Files/LLVM/msbuild-bin/cl.exe -- works
...
-- Conan: called by CMake conan helper
CMake Error at D:/conan-cache/.../conanbuildinfo.cmake:416 (message):
  Incorrect 'Visual Studio', is not the one detected by CMake: 'Clang'
Call Stack (most recent call first):
  D:/conan-cache/.../conanbuildinfo.cmake:115 (conan_check_compiler)
  CMakeLists.txt:6 (conan_basic_setup)

Since this compiler.toolset option is present in the default settings.yml, I presume this is supposed to work. My guess at the right way to approach this is to teach the CMake generator about compiler.toolset, which it is currently blissfully ignorant of. The downside is that it also means teaching the generator about this setup (and would potentially not work for custom toolsets).

@memsharded
Copy link
Member

Actually, the CMake is passing the -T option, and it is being used, but it is the check in the conanbuildinfo.cmake that detects that the compiler being used is Clang, and not Visual Studio.

Certainly the support for Clang in Windows has to be improved.

Maybe @SSE4 can help further, has expertise in it.

@memsharded memsharded added this to the 1.1 milestone Jan 9, 2018
@mpdelbuono
Copy link
Contributor Author

Yeah, sorry if I wasn't clear - I recognize that the problem is in the generation of the conanbuildinfo.cmake, not in CMake itself (which is passing the correct -T option). I think I see the problem in the generator and have a patch, but I need to test it a little bit first; assuming it's good I'll submit a pull request.

mpdelbuono added a commit to mpdelbuono/conan that referenced this issue Jan 10, 2018
…lset would not be able to compile due to the compiler check failing.
mpdelbuono added a commit to mpdelbuono/conan that referenced this issue Jan 10, 2018
…lset would not be able to compile due to the compiler check failing.
mpdelbuono added a commit to mpdelbuono/conan that referenced this issue Jan 10, 2018
…lset would not be able to compile due to the compiler check failing.
lasote pushed a commit that referenced this issue Jan 10, 2018
…ld not be able to compile due to the compiler check failing. (#2287)
lasote pushed a commit that referenced this issue Jan 12, 2018
* Contributing guides and templates (#2123)

* Contributing guides and templates

* Typo

* Review

* Bad quote

* Review

* maintainers and contributors

* some minor fixes

* Dummy change

* dummy change2

* Removed weird new line

* Fix diamond test function (#2220)

* Dev version

* Fixes issue #2285 where Visual Studio users using a clang toolset would not be able to compile due to the compiler check failing. (#2287)

* remove None settings from conaninfo

* correct version
lasote pushed a commit that referenced this issue Jan 22, 2018
* Contributing guides and templates (#2123)

* Contributing guides and templates

* Typo

* Review

* Bad quote

* Review

* maintainers and contributors

* some minor fixes

* Dummy change

* dummy change2

* Removed weird new line

* Fix diamond test function (#2220)

* Dev version

* Fixes issue #2285 where Visual Studio users using a clang toolset would not be able to compile due to the compiler check failing. (#2287)

* fixing the local flow when settings are removed

* new options setting

* fixed error with settings_preprocessor

* fixed broken test in linux
@memsharded
Copy link
Member

I think this issue was closed by #2287, and already released, please check.

@mpdelbuono
Copy link
Contributor Author

Sorry for the delay, but I just confirmed that this works. In fact, I confirmed it very hard because apparently an upgrade to Visual Studio caused my LLVM install to break, and conan was correctly detecting that it was falling back to the MSVC compiler instead of using LLVM like it should.

Thanks,

@lasote lasote closed this as completed Feb 23, 2018
@ghost ghost removed the to do label Feb 23, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
…lset would not be able to compile due to the compiler check failing. (conan-io#2287)
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
* Contributing guides and templates (conan-io#2123)

* Contributing guides and templates

* Typo

* Review

* Bad quote

* Review

* maintainers and contributors

* some minor fixes

* Dummy change

* dummy change2

* Removed weird new line

* Fix diamond test function (conan-io#2220)

* Dev version

* Fixes issue conan-io#2285 where Visual Studio users using a clang toolset would not be able to compile due to the compiler check failing. (conan-io#2287)

* remove None settings from conaninfo

* correct version
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
* Contributing guides and templates (conan-io#2123)

* Contributing guides and templates

* Typo

* Review

* Bad quote

* Review

* maintainers and contributors

* some minor fixes

* Dummy change

* dummy change2

* Removed weird new line

* Fix diamond test function (conan-io#2220)

* Dev version

* Fixes issue conan-io#2285 where Visual Studio users using a clang toolset would not be able to compile due to the compiler check failing. (conan-io#2287)

* fixing the local flow when settings are removed

* new options setting

* fixed error with settings_preprocessor

* fixed broken test in linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants