Skip to content

Commit

Permalink
Fix build error on Windows (PaddlePaddle#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangjiajun authored and felixhjh committed Nov 25, 2022
1 parent 032b119 commit 39b9042
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39b9042

Please sign in to comment.