Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed cmake linking issues #14

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading