From 2c90610020630243d227e4bf603ac3e8f29f780a Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 22 Nov 2022 14:55:36 +0800 Subject: [PATCH] Fix build error on Windows (#653) --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 203e35d9db..f767272f18 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,7 +369,9 @@ if(ENABLE_TRT_BACKEND) message(STATUS "Copying ${TRT_DIRECTORY}/lib to ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/tensorrt/lib ...") execute_process(COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/copy_directory.py ${TRT_DIRECTORY}/lib ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/tensorrt/lib) file(GLOB_RECURSE TRT_STAIC_LIBS ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/tensorrt/lib/*.a) - file(REMOVE ${TRT_STAIC_LIBS}) + if(TRT_STATIC_LIBS) + file(REMOVE ${TRT_STAIC_LIBS}) + endif() if(UNIX AND (NOT APPLE) AND (NOT ANDROID)) execute_process(COMMAND sh -c "ls *.so*" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/tensorrt/lib COMMAND sh -c "xargs ${PATCHELF_EXE} --set-rpath '$ORIGIN'" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/tensorrt/lib