From 5cc5da6fa8753a7c93ea39de56a5206a6864c77e Mon Sep 17 00:00:00 2001 From: juncaipeng <13006307475@163.com> Date: Wed, 23 Oct 2019 02:45:43 +0000 Subject: [PATCH] add cuda_kernels just with LITE_WITH_CUDA --- lite/api/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index 093195b63a..a085a39aa8 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -15,8 +15,10 @@ if (NOT LITE_ON_TINY_PUBLISH) add_library(paddle_full_api_shared SHARED "") target_sources(paddle_full_api_shared PUBLIC ${__lite_cc_files} paddle_api.cc light_api.cc cxx_api.cc cxx_api_impl.cc light_api_impl.cc) add_dependencies(paddle_full_api_shared op_list_h kernel_list_h framework_proto xxhash ) - target_link_libraries(paddle_full_api_shared framework_proto xxhash ${math_cuda})# ${cuda_kernels}) - target_link_libraries(paddle_full_api_shared "-Wl,--whole-archive" ${cuda_kernels} "-Wl,--no-whole-archive") + target_link_libraries(paddle_full_api_shared framework_proto xxhash)# ${cuda_kernels}) + if(LITE_WITH_CUDA) + target_link_libraries(paddle_full_api_shared ${math_cuda} "-Wl,--whole-archive" ${cuda_kernels} "-Wl,--no-whole-archive") + endif(LITE_WITH_CUDA) add_dependencies(lite_compile_deps paddle_full_api_shared) #light api dynamic library lite_cc_library(paddle_light_api_shared MODULE -- GitLab