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

Missing MSVC version checks in conanbuildinfo.cmake #1838

Closed
dutow opened this issue Oct 2, 2017 · 4 comments
Closed

Missing MSVC version checks in conanbuildinfo.cmake #1838

dutow opened this issue Oct 2, 2017 · 4 comments

Comments

@dutow
Copy link

dutow commented Oct 2, 2017

The following version checks are generated for Visual Studio in conanbuildinfo.cmake:

if( (CONAN_COMPILER_VERSION STREQUAL "14" AND NOT VERSION_MAJOR STREQUAL "19") OR
            (CONAN_COMPILER_VERSION STREQUAL "12" AND NOT VERSION_MAJOR STREQUAL "18") OR
            (CONAN_COMPILER_VERSION STREQUAL "11" AND NOT VERSION_MAJOR STREQUAL "17") OR
            (CONAN_COMPILER_VERSION STREQUAL "10" AND NOT VERSION_MAJOR STREQUAL "16") OR
            (CONAN_COMPILER_VERSION STREQUAL "9" AND NOT VERSION_MAJOR STREQUAL "15") OR
            (CONAN_COMPILER_VERSION STREQUAL "8" AND NOT VERSION_MAJOR STREQUAL "14") OR
            (CONAN_COMPILER_VERSION STREQUAL "7" AND NOT VERSION_MAJOR STREQUAL "13") OR
            (CONAN_COMPILER_VERSION STREQUAL "6" AND NOT VERSION_MAJOR STREQUAL "12") )
            conan_error_compiler_version()
        endif()

There are several bugs here:

  1. It has no entry for Visual Studio 2017 (major 19 minor 11)
  2. It doesn't check the minor version for Visual Studio 2015, and thus would also accept VS 2017 (which should be okay according to Microsoft - but it's not the way conan behaves for other otherwise compatible compilers)
  3. It accepts any Visual Studio version not known by conan (for example, CONAN_COMPILER_VERSION "15", which is used for VS 2017)

(I found where these lines are written out, and considered submitting a pull request, but I wasn't sure how the second problem should be handled)

@memsharded
Copy link
Member

Yes, this is true.
These lines are here for an extra-check about consistency of settings, so the guideline is: "only fail if you are quite sure it is an error". Otherwise, let it pass.

So the idea is working fine: It allows building for VS2017, even if there is no check for it. So point 3 is quite on purpose, it worked fine. We really don't want to block legit uses because of a bug in the version checker.

A PR would be great, indeed. Regarding the minor (point 2), I think you might use VERSION_MINOR as well. If it doesn't work, no problem, just add the major, it would be an improvement.

Thanks!

@uilianries
Copy link
Member

@SSE4 could we close this one?

@SSE4
Copy link
Contributor

SSE4 commented Jun 28, 2019

okay

@danimtb
Copy link
Member

danimtb commented Jul 10, 2019

Confirmed as fixed by this PR #5041 Thanks!

@danimtb danimtb closed this as completed Jul 10, 2019
@danimtb danimtb removed the to do label Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants