From 6fb065838a05c5477566074af331e56e5ffe8d57 Mon Sep 17 00:00:00 2001 From: Umesh-k26 Date: Tue, 30 Jan 2024 16:54:14 +0530 Subject: [PATCH] Fixed cmake linking issues --- CMakeLists.txt | 6 ++---- MLModelRunner/ONNXModelRunner/CMakeLists.txt | 2 +- SerDes/CMakeLists.txt | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 765510d..af5f079 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,7 @@ if(LLVM_MLBRIDGE) LINK_LIBS ModelRunnerLib - $ - tf_xla_runtime - protobuf::libprotobuf + SerDesLib ) target_include_directories(LLVMMLBridge SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS} ${TENSORFLOW_AOT_PATH}/include) @@ -66,7 +64,7 @@ else() llvm_map_components_to_libnames(llvm_libs support core irreader analysis TransformUtils) add_library(MLCompilerBridge STATIC tools.cpp) - target_link_libraries(MLCompilerBridge PUBLIC SerDesLib ModelRunnerLib ONNXModelRunnerLib ${llvm_libs} tf_xla_runtime protobuf::libprotobuf) + target_link_libraries(MLCompilerBridge PUBLIC SerDesLib ModelRunnerLib ONNXModelRunnerLib ${llvm_libs}) set_target_properties(MLCompilerBridge PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set_property(TARGET MLCompilerBridge PROPERTY POSITION_INDEPENDENT_CODE 1) install(TARGETS MLCompilerBridge DESTINATION lib) diff --git a/MLModelRunner/ONNXModelRunner/CMakeLists.txt b/MLModelRunner/ONNXModelRunner/CMakeLists.txt index 92f9a1a..ea31f4b 100755 --- a/MLModelRunner/ONNXModelRunner/CMakeLists.txt +++ b/MLModelRunner/ONNXModelRunner/CMakeLists.txt @@ -50,6 +50,6 @@ add_library(ONNXModelRunnerLib OBJECT onnx.cpp ) endif(LLVM_MLBRIDGE) -target_link_libraries(ONNXModelRunnerLib PUBLIC onnxruntime) target_include_directories(ONNXModelRunnerLib PUBLIC "${ONNXRUNTIME_ROOTDIR}/include" "${ONNXRUNTIME_ROOTDIR}/include/onnxruntime/core/session" ${TENSORFLOW_AOT_PATH}/include) target_link_directories(ONNXModelRunnerLib PUBLIC ${ONNXRUNTIME_ROOTDIR}/lib) +target_link_libraries(ONNXModelRunnerLib PRIVATE onnxruntime) diff --git a/SerDes/CMakeLists.txt b/SerDes/CMakeLists.txt index d06ef68..0709da4 100755 --- a/SerDes/CMakeLists.txt +++ b/SerDes/CMakeLists.txt @@ -15,4 +15,5 @@ else() add_library(SerDesCLib OBJECT TensorSpec.cpp jsonSerDes.cpp bitstreamSerDes.cpp JSON.cpp) endif() -target_include_directories(SerDesLib PRIVATE ${TENSORFLOW_AOT_PATH}/include) +target_include_directories(SerDesLib PUBLIC ${TENSORFLOW_AOT_PATH}/include) +target_link_libraries(SerDesLib PRIVATE tf_xla_runtime)