Skip to content

Commit

Permalink
Bugfix: do not check patch compiler version (#6976)
Browse files Browse the repository at this point in the history
* - do not check patch compiler version

Signed-off-by: SSE4 <tomskside@gmail.com>

* Update cmake_common.py
  • Loading branch information
SSE4 committed May 8, 2020
1 parent d1869e1 commit 50f2059
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions conans/client/generators/cmake_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ class CMakeCommonMacros:
message(FATAL_ERROR "Detected a mismatch for the compiler version between your conan profile settings and CMake: \\n"
"Compiler version specified in your conan profile: ${CONAN_COMPILER_VERSION}\\n"
"Compiler version detected in CMake: ${VERSION_MAJOR}.${VERSION_MINOR}\\n"
"Please check your conan profile settings (conan profile show [default|your_profile_name])"
"Please check your conan profile settings (conan profile show [default|your_profile_name])\\n"
"P.S. You may set CONAN_DISABLE_CHECK_COMPILER CMake variable in order to disable this check."
)
endmacro()
""")
Expand Down Expand Up @@ -487,29 +488,34 @@ class CMakeCommonMacros:
conan_error_compiler_version()
endif()
elseif(CONAN_COMPILER STREQUAL "gcc")
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
set(_CHECK_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 5.0)
conan_message(STATUS "Conan: Compiler GCC>=5, checking major version ${CONAN_COMPILER_VERSION}")
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
if("${CONAN_COMPILER_MINOR}" STREQUAL "")
set(_CHECK_VERSION ${VERSION_MAJOR})
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR})
endif()
endif()
conan_message(STATUS "Conan: Checking correct version: ${_CHECK_VERSION}")
if(NOT ${_CHECK_VERSION} VERSION_EQUAL CONAN_COMPILER_VERSION)
if(NOT ${_CHECK_VERSION} VERSION_EQUAL ${_CONAN_VERSION})
conan_error_compiler_version()
endif()
elseif(CONAN_COMPILER STREQUAL "clang")
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
set(_CHECK_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 8.0)
conan_message(STATUS "Conan: Compiler Clang>=8, checking major version ${CONAN_COMPILER_VERSION}")
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
if("${CONAN_COMPILER_MINOR}" STREQUAL "")
set(_CHECK_VERSION ${VERSION_MAJOR})
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR})
endif()
endif()
conan_message(STATUS "Conan: Checking correct version: ${_CHECK_VERSION}")
if(NOT ${_CHECK_VERSION} VERSION_EQUAL CONAN_COMPILER_VERSION)
if(NOT ${_CHECK_VERSION} VERSION_EQUAL ${_CONAN_VERSION})
conan_error_compiler_version()
endif()
elseif(CONAN_COMPILER STREQUAL "apple-clang" OR CONAN_COMPILER STREQUAL "sun-cc")
Expand All @@ -518,13 +524,13 @@ class CMakeCommonMacros:
conan_error_compiler_version()
endif()
elseif(CONAN_COMPILER STREQUAL "intel")
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 19.1)
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
if(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
conan_error_compiler_version()
endif()
else()
if(NOT ${VERSION_MAJOR} VERSION_EQUAL ${CONAN_COMPILER_VERSION})
if(NOT ${VERSION_MAJOR} VERSION_EQUAL ${CONAN_COMPILER_MAJOR})
conan_error_compiler_version()
endif()
endif()
Expand Down

0 comments on commit 50f2059

Please sign in to comment.