Commit 0593746d authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

add EXCLUDE_FROM_ALL to codegen directory (#1441)

* add EXCLUDE_FROM_ALL to codegen library so we don't need to using conditionals in build. If codegen is needed it will be built.

* update llvm dependencies
parent 68ec623d
...@@ -175,5 +175,6 @@ else() ...@@ -175,5 +175,6 @@ else()
endif() endif()
add_library(libllvm INTERFACE) add_library(libllvm INTERFACE)
add_dependencies(libllvm ext_llvm)
target_include_directories(libllvm SYSTEM INTERFACE ${EXTERNAL_PROJECTS_ROOT}/llvm/include) target_include_directories(libllvm SYSTEM INTERFACE ${EXTERNAL_PROJECTS_ROOT}/llvm/include)
target_link_libraries(libllvm INTERFACE ${LLVM_LINK_LIBS}) target_link_libraries(libllvm INTERFACE ${LLVM_LINK_LIBS})
...@@ -139,5 +139,6 @@ set(LLVM_LINK_LIBS ...@@ -139,5 +139,6 @@ set(LLVM_LINK_LIBS
) )
add_library(libllvm INTERFACE) add_library(libllvm INTERFACE)
add_dependencies(libllvm ext_llvm)
target_include_directories(libllvm SYSTEM INTERFACE ${SOURCE_DIR}/include) target_include_directories(libllvm SYSTEM INTERFACE ${SOURCE_DIR}/include)
target_link_libraries(libllvm INTERFACE ${LLVM_LINK_LIBS}) target_link_libraries(libllvm INTERFACE ${LLVM_LINK_LIBS})
...@@ -166,6 +166,7 @@ add_custom_command(TARGET ext_mkldnn POST_BUILD ...@@ -166,6 +166,7 @@ add_custom_command(TARGET ext_mkldnn POST_BUILD
) )
add_library(libmkldnn INTERFACE) add_library(libmkldnn INTERFACE)
add_dependencies(libmkldnn ext_mkldnn)
target_include_directories(libmkldnn SYSTEM INTERFACE ${EXTERNAL_PROJECTS_ROOT}/mkldnn/include) target_include_directories(libmkldnn SYSTEM INTERFACE ${EXTERNAL_PROJECTS_ROOT}/mkldnn/include)
target_link_libraries(libmkldnn INTERFACE target_link_libraries(libmkldnn INTERFACE
${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmkldnn${CMAKE_SHARED_LIBRARY_SUFFIX} ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmkldnn${CMAKE_SHARED_LIBRARY_SUFFIX}
......
...@@ -185,7 +185,7 @@ endif() ...@@ -185,7 +185,7 @@ endif()
include_directories("${NGRAPH_INCLUDE_PATH}") include_directories("${NGRAPH_INCLUDE_PATH}")
add_subdirectory(codegen) add_subdirectory(codegen EXCLUDE_FROM_ALL)
add_subdirectory(runtime) add_subdirectory(runtime)
add_library(ngraph SHARED ${SRC}) add_library(ngraph SHARED ${SRC})
......
...@@ -69,13 +69,9 @@ add_custom_target(header_resource ...@@ -69,13 +69,9 @@ add_custom_target(header_resource
BYPRODUCTS BYPRODUCTS
) )
# The conditional is a hack. I want to use EXCLUDE_FROM_ALL and OPTIONAL but that does not add_library(codegen SHARED ${SRC})
# seem to be working for me. set_target_properties(codegen PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION})
if ((NGRAPH_CPU_ENABLE AND NOT NGRAPH_DEX_ONLY) OR NGRAPH_GPU_ENABLE) add_dependencies(codegen header_resource libmkldnn libeigen)
add_library(codegen SHARED ${SRC}) target_include_directories(codegen SYSTEM PUBLIC ${CMAKE_BINARY_DIR})
set_target_properties(codegen PROPERTIES VERSION ${NGRAPH_VERSION} SOVERSION ${NGRAPH_API_VERSION}) target_link_libraries(codegen PRIVATE libllvm ngraph)
add_dependencies(codegen header_resource libmkldnn libeigen) install(TARGETS codegen DESTINATION ${NGRAPH_INSTALL_LIB})
target_include_directories(codegen SYSTEM PUBLIC ${CMAKE_BINARY_DIR})
target_link_libraries(codegen PRIVATE libllvm ngraph)
install(TARGETS codegen DESTINATION ${NGRAPH_INSTALL_LIB})
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