Commit cf3bae10 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CMake: Predicate LLVM and MKL-DNN integration into ngraph under

NGRAPH_CPU_ENABLE
parent 11b612ca
...@@ -99,7 +99,8 @@ include_directories( ...@@ -99,7 +99,8 @@ include_directories(
"${EIGEN_INCLUDE_DIR}" "${EIGEN_INCLUDE_DIR}"
) )
if(LLVM_INCLUDE_DIR AND MKLDNN_INCLUDE_DIR) if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
MKLDNN_INCLUDE_DIR)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR} ${MKLDNN_INCLUDE_DIR}) include_directories(SYSTEM ${LLVM_INCLUDE_DIR} ${MKLDNN_INCLUDE_DIR})
...@@ -131,7 +132,7 @@ endif() ...@@ -131,7 +132,7 @@ endif()
add_library(ngraph SHARED ${SRC}) add_library(ngraph SHARED ${SRC})
target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}") target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}")
if(LLVM_LINK_LIBS) if(NGRAPH_CPU_ENABLE AND LLVM_LINK_LIBS)
target_link_libraries(ngraph LINK_PRIVATE ${LLVM_LINK_LIBS}) target_link_libraries(ngraph LINK_PRIVATE ${LLVM_LINK_LIBS})
endif() endif()
...@@ -141,7 +142,7 @@ if (APPLE) ...@@ -141,7 +142,7 @@ if (APPLE)
set_property(TARGET ngraph PROPERTY SUFFIX "") set_property(TARGET ngraph PROPERTY SUFFIX "")
endif() endif()
if(MKLDNN_LIB_DIR) if(NGRAPH_CPU_ENABLE AND MKLDNN_LIB_DIR)
target_link_libraries(ngraph LINK_PRIVATE mkldnn) target_link_libraries(ngraph LINK_PRIVATE mkldnn)
endif() endif()
...@@ -182,10 +183,10 @@ endif() ...@@ -182,10 +183,10 @@ endif()
add_dependencies(ngraph eigen) add_dependencies(ngraph eigen)
if(NOT LLVM_PACKAGED AND LLVM_INCLUDE_DIR) if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
add_dependencies(ngraph ext_llvm) add_dependencies(ngraph ext_llvm)
endif() endif()
if(MKLDNN_INCLUDE_DIR) if(NGRAPH_CPU_ENABLE AND MKLDNN_INCLUDE_DIR)
add_dependencies(ngraph ext_mkldnn) add_dependencies(ngraph ext_mkldnn)
endif() endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment