Skip to content

Commit

Permalink
Merge pull request #14 from IITH-Compilers/cmake-fixes
Browse files Browse the repository at this point in the history
Fixed cmake linking issues
  • Loading branch information
Umesh-k26 authored Jan 30, 2024
2 parents f609d83 + 1faf430 commit 8306513
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ if(LLVM_MLBRIDGE)

LINK_LIBS
ModelRunnerLib
$<TARGET_OBJECTS:SerDesLib>
tf_xla_runtime
protobuf::libprotobuf
SerDesLib
)

target_include_directories(LLVMMLBridge SYSTEM PUBLIC ${Protobuf_INCLUDE_DIRS} ${TENSORFLOW_AOT_PATH}/include)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion MLModelRunner/ONNXModelRunner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion SerDes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8306513

Please sign in to comment.