diff --git a/cmake/onnxruntime_providers_openvino.cmake b/cmake/onnxruntime_providers_openvino.cmake index ff2d4b388e82e..b58402bc5bf24 100644 --- a/cmake/onnxruntime_providers_openvino.cmake +++ b/cmake/onnxruntime_providers_openvino.cmake @@ -17,7 +17,7 @@ message(FATAL_ERROR "OpenVINO 2024.5 and newer are supported. Please, use latest OpenVINO release") endif() - if(OpenVINO_VERSION VERSION_GREATER_EQUAL 2024.4) + if(onnxruntime_USE_OPENVINO_NPU AND (OpenVINO_VERSION VERSION_GREATER_EQUAL 2024.4)) add_definitions(-DUSE_OVEP_NPU_MEMORY=1) endif()