From cbf59cbba45b40e61f2c162dbfb2f19e60ed4f64 Mon Sep 17 00:00:00 2001 From: Yan Chunwei Date: Tue, 11 Jun 2019 14:36:50 +0800 Subject: [PATCH] fix mobile compile (#17953) --- paddle/fluid/lite/gen_code/CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/paddle/fluid/lite/gen_code/CMakeLists.txt b/paddle/fluid/lite/gen_code/CMakeLists.txt index 5d09dd567ea..f7c38c176e1 100644 --- a/paddle/fluid/lite/gen_code/CMakeLists.txt +++ b/paddle/fluid/lite/gen_code/CMakeLists.txt @@ -11,14 +11,16 @@ lite_cc_test(test_gen_code_lite SRCS gen_code_test.cc DEPS gen_code_lite ${tenso X86_DEPS mul_compute_x86 ARGS --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL) -lite_cc_library(__generated_code__ - SRCS ${CMAKE_BINARY_DIR}/paddle/fluid/lite/gen_code/__generated_code__.cc - DEPS scope_lite op_lite kernel_lite paddle_infer_gencode -) +if (NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) + lite_cc_library(__generated_code__ + SRCS ${CMAKE_BINARY_DIR}/paddle/fluid/lite/gen_code/__generated_code__.cc + DEPS scope_lite op_lite kernel_lite paddle_infer_gencode + ) -lite_cc_test(test_generated_code SRCS generated_code_test.cc DEPS __generated_code__ - ${ops_lite} ${host_kernels} - X86_DEPS ${x86_kernels} - ) + lite_cc_test(test_generated_code SRCS generated_code_test.cc DEPS __generated_code__ + ${ops_lite} ${host_kernels} + X86_DEPS ${x86_kernels} + ) -add_dependencies(__generated_code__ test_gen_code_lite) + add_dependencies(__generated_code__ test_gen_code_lite) +endif() -- GitLab