From 40c4d29737e1a8187d76388b98d828060a68c466 Mon Sep 17 00:00:00 2001 From: Lingjie Li Date: Tue, 13 Aug 2024 20:08:24 +0800 Subject: [PATCH] build: add DEVICEIMPL as imported library in droplet --- impl/droplet/CMakeLists.txt | 5 ++++- impl/droplet/test/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/impl/droplet/CMakeLists.txt b/impl/droplet/CMakeLists.txt index f6ec94ff66..57f3ca5d7d 100644 --- a/impl/droplet/CMakeLists.txt +++ b/impl/droplet/CMakeLists.txt @@ -14,9 +14,12 @@ endif() find_library(DIOPI_DROPLET_LIB NAMES ${DEVICEIMPL} HINTS ${DIOPI_DROPLET_DIR}/lib) message(STATUS "DIOPI-IMPL lib: ${DIOPI_DROPLET_LIB}") if(NOT DIOPI_DROPLET_LIB) - message(FATAL_ERROR "${DEVICEIMPL} library not found !") + message(FATAL_ERROR "${DEVICEIMPL} library not found !") endif() +add_library(${DEVICEIMPL} SHARED IMPORTED GLOBAL) +set_target_properties(${DEVICEIMPL} PROPERTIES IMPORTED_LOCATION ${DIOPI_DROPLET_LIB}) + if (TEST) add_subdirectory(test) endif() diff --git a/impl/droplet/test/CMakeLists.txt b/impl/droplet/test/CMakeLists.txt index ce5748e617..65c53e3e3f 100644 --- a/impl/droplet/test/CMakeLists.txt +++ b/impl/droplet/test/CMakeLists.txt @@ -52,7 +52,7 @@ endif() target_link_libraries(${DIOPI_EXPORT_RT} PRIVATE -Wl,--no-as-needed diopiruntime -Wl,--as-needed) target_link_libraries(diopiruntime tangrt_shared) -target_link_libraries(diopiruntime ${DIOPI_DROPLET_LIB}) +target_link_libraries(diopiruntime ${DEVICEIMPL}) set(FUNCTION_SAVE_PATH "${DIOPI_TEST_DIR}/diopi_stub/csrc")