diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt index a05ca3b15c624d..55e218daa2c924 100644 --- a/ngraph/CMakeLists.txt +++ b/ngraph/CMakeLists.txt @@ -84,6 +84,7 @@ if (APPLE) endif() option(NGRAPH_UNIT_TEST_ENABLE "Control the building of unit tests" ON) +option(NGRAPH_UNIT_TEST_BACKENDS_ENABLE "Control the building of unit tests using backends" ON) option(NGRAPH_INTERPRETER_ENABLE "Control the building of the INTERPRETER backend" ON) option(NGRAPH_DEBUG_ENABLE "Enable output for NGRAPH_DEBUG statements" OFF) option(NGRAPH_ONNX_IMPORT_ENABLE "Enable ONNX importer" OFF) @@ -117,6 +118,7 @@ message(STATUS "NGRAPH_THREAD_SANITIZER_ENABLE: ${NGRAPH_THREAD_SANITIZER_ message(STATUS "NGRAPH_UB_SANITIZER_ENABLE: ${NGRAPH_UB_SANITIZER_ENABLE}") message(STATUS "NGRAPH_USE_PROTOBUF_LITE: ${NGRAPH_USE_PROTOBUF_LITE}") message(STATUS "NGRAPH_UNIT_TEST_ENABLE: ${NGRAPH_UNIT_TEST_ENABLE}") +message(STATUS "NGRAPH_UNIT_TEST_BACKENDS_ENABLE: ${NGRAPH_UNIT_TEST_BACKENDS_ENABLE}") # Setup CMAKE_ARGS to be forwarded to External Projects set(NGRAPH_FORWARD_CMAKE_ARGS diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index fcb4f013775139..278121669a83c1 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -304,7 +304,7 @@ set(SRC set_source_files_properties(includes.cpp PROPERTIES COMPILE_DEFINITIONS NGRAPH_INCLUDES="${PROJECT_SOURCE_DIR}/src/ngraph") -if (ENABLE_MKL_DNN) +if (ENABLE_MKL_DNN AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE) message(STATUS "NGRAPH_TESTS: IE:CPU enabled") set(ACTIVE_BACKEND_LIST ${ACTIVE_BACKEND_LIST} "IE:CPU") if (ENABLE_STRICT_DEPENDENCIES) @@ -314,7 +314,7 @@ if (ENABLE_MKL_DNN) endif() endif() -if (ENABLE_CLDNN) +if (ENABLE_CLDNN AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE) message(STATUS "NGRAPH_TESTS: IE:GPU enabled") set(ACTIVE_BACKEND_LIST ${ACTIVE_BACKEND_LIST} "IE:GPU") if (ENABLE_STRICT_DEPENDENCIES) @@ -324,7 +324,7 @@ if (ENABLE_CLDNN) endif() endif() -if (NGRAPH_INTERPRETER_ENABLE) +if (NGRAPH_INTERPRETER_ENABLE AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE) list(APPEND SRC builder.cpp backend_api.cpp)