2020-04-16 14:38:52 +08:00
|
|
|
# Create shared libcruntime.so since model.so linkage for backend tests
|
|
|
|
# will fail on x86 Linux if cruntime is statically linked.
|
|
|
|
add_library(cruntime SHARED
|
2020-03-19 16:48:09 +08:00
|
|
|
DynMemRef.cpp
|
|
|
|
DynMemRef.h
|
|
|
|
DataType.h)
|
2019-12-22 13:25:02 +08:00
|
|
|
target_include_directories(cruntime
|
2020-03-17 21:16:33 +08:00
|
|
|
PRIVATE ${ONNX_MLIR_SRC_ROOT} ${ONNX_MLIR_BIN_ROOT}
|
|
|
|
${ONNX_MLIR_SRC_ROOT})
|
2019-12-22 13:25:02 +08:00
|
|
|
|
|
|
|
pybind11_add_module(pyruntime
|
2020-03-19 16:48:09 +08:00
|
|
|
DynMemRef.cpp
|
|
|
|
DynMemRef.h
|
|
|
|
Runtime.cpp
|
|
|
|
Runtime.hpp)
|
2019-12-22 13:25:02 +08:00
|
|
|
target_link_libraries(pyruntime PRIVATE ${CMAKE_DL_LIBS})
|
|
|
|
target_include_directories(pyruntime
|
2020-03-17 21:16:33 +08:00
|
|
|
PRIVATE ${ONNX_MLIR_SRC_ROOT} ${ONNX_MLIR_BIN_ROOT}
|
|
|
|
${ONNX_MLIR_SRC_ROOT})
|
2019-12-23 12:52:49 +08:00
|
|
|
add_dependencies(pyruntime cruntime)
|
2020-05-26 16:05:00 +08:00
|
|
|
install(FILES Runtime/DynMemRef.h DESTINATION include)
|
|
|
|
install(TARGETS cruntime DESTINATION lib)
|