From c10bc6d652913f14c9a5eec956ad968bf5bc16c4 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Fri, 20 Sep 2019 21:11:12 +0800 Subject: [PATCH] fix compiling and fix code style (#2088) * fix compiling and fix code style test=develop --- cmake/generic.cmake | 8 ++++++-- lite/core/mir/memory_optimize_pass.cc | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index 1bf77867b0..3d05bad64b 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -303,8 +303,12 @@ function(cc_library TARGET_NAME) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source}.h) list(APPEND cc_library_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${source}.h) endif() - if(NOT ${source_file} MATCHES "framework.pb.cc") - list(APPEND full_path_src ${CMAKE_CURRENT_SOURCE_DIR}/${source_file}) + if(${source_file} MATCHES "__generated_code__.cc") + list(APPEND full_path_src ${source_file}) + else() + if(NOT ${source_file} MATCHES "framework.pb.cc") + list(APPEND full_path_src ${CMAKE_CURRENT_SOURCE_DIR}/${source_file}) + endif() endif() endforeach() set(__lite_cc_files ${__lite_cc_files} ${full_path_src} CACHE INTERNAL "") diff --git a/lite/core/mir/memory_optimize_pass.cc b/lite/core/mir/memory_optimize_pass.cc index 6956e805c6..ef6dfcff09 100644 --- a/lite/core/mir/memory_optimize_pass.cc +++ b/lite/core/mir/memory_optimize_pass.cc @@ -77,7 +77,6 @@ void MemoryOptimizePass::CollectLifeCycleByDevice( auto outputs = op_node->outlinks; std::vector requires(inputs.begin(), inputs.end()); requires.insert(requires.end(), outputs.begin(), outputs.end()); - auto& stmt = op_node->AsStmt(); for (Node* node : requires) { CHECK(node->IsArg()); auto& arg = node->AsArg(); -- GitLab