Skip to content

Commit

Permalink
check version of CMAKE_CXX_COMPILER_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Sep 12, 2024
1 parent e611ede commit fe19c2c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,18 @@ function(ov_check_python_build_conditions)
set(python_debug OFF)
endif()

if((Python3_Development.Module_FOUND OR Python3_Development_FOUND) AND NOT python_debug)
# Python bindings compiled with the 14.28 toolset (19.28 compiler) could not be imported by another Pybind module linked with OpenVINO
if (MSVC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.29)
set(msvc_supported OFF)
message(${message_mode} "MSVC toolset version 14.28.x (19.28.x compiler) is not supported. Please update your toolset (${CMAKE_CXX_COMPILER_VERSION}).")
else()
set(msvc_supported ON)
message(STATUS "MSVC toolset version: ${CMAKE_CXX_COMPILER_VERSION}")
endif()
endif()

if((Python3_Development.Module_FOUND OR Python3_Development_FOUND) AND NOT python_debug AND msvc_supported)
set(ENABLE_PYTHON_DEFAULT ON PARENT_SCOPE)
else()
set(ENABLE_PYTHON_DEFAULT OFF PARENT_SCOPE)
Expand Down

0 comments on commit fe19c2c

Please sign in to comment.