From d75b715f9275b1411851ac9bea8794a5407eaf99 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Mon, 1 Jul 2019 19:28:33 +0800 Subject: [PATCH] Fix linking issue for CMake 3.3 and above --- demo-serving/CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/demo-serving/CMakeLists.txt b/demo-serving/CMakeLists.txt index 5b9f564e..fb7abeb5 100644 --- a/demo-serving/CMakeLists.txt +++ b/demo-serving/CMakeLists.txt @@ -27,13 +27,27 @@ target_include_directories(serving PUBLIC ) if(WITH_GPU) - target_link_libraries(serving ${CUDA_LIBRARIES} -Wl,--whole-archive fluid_gpu_engine + target_link_libraries(serving -Wl,--whole-archive fluid_gpu_engine -Wl,--no-whole-archive) endif() + +target_link_libraries(serving -Wl,--whole-archive fluid_cpu_engine + -Wl,--no-whole-archive) + +target_link_libraries(serving paddle_fluid ${paddle_depend_libs}) + target_link_libraries(serving opencv_imgcodecs - ${opencv_depend_libs} -Wl,--whole-archive fluid_cpu_engine - -Wl,--no-whole-archive pdserving paddle_fluid ${paddle_depend_libs} kvdb rocksdb - ${MKLML_LIB} ${MKLML_IOMP_LIB} -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2) + ${opencv_depend_libs}) + +target_link_libraries(serving pdserving) + +target_link_libraries(serving kvdb rocksdb) + +if(WITH_GPU) + target_link_libraries(serving ${CUDA_LIBRARIES}) +endif() +target_link_libraries(serving ${MKLML_LIB} ${MKLML_IOMP_LIB} -lpthread + -lcrypto -lm -lrt -lssl -ldl -lz lbz2) install(TARGETS serving RUNTIME DESTINATION -- GitLab