Skip to content

Commit

Permalink
[Pybind] Check version of CMAKE_CXX_COMPILER_VERSION (#26550)
Browse files Browse the repository at this point in the history
### Details:
Python bindings compiled with the 14.28 toolset (19.28 compiler) could
not be imported by another Pybind module linked with OpenVINO

### Tickets:
 - *149694*

---------

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
  • Loading branch information
mryzhov and ilya-lavrenov committed Sep 14, 2024
1 parent 4e17541 commit 00861cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ function(ov_check_python_build_conditions)
set(python_debug OFF)
endif()

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

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

0 comments on commit 00861cd

Please sign in to comment.