diff --git a/CMakeLists.txt b/CMakeLists.txt index ae84f8eb31a353be636d507031325f743cdc2ec2..e9d3b03cb1fcd5c22e95591173009580c24b9e53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,16 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) include(cross_compiling/host) include(cross_compiling/armlinux) include(cross_compiling/android) + + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Default use Release in android" FORCE) + endif() + if(NOT THIRD_PARTY_BUILD_TYPE) + set(THIRD_PARTY_BUILD_TYPE "MinSizeRel" CACHE STRING + "Default use MinSizeRel in android" FORCE) + endif() + endif() project(paddle CXX C) @@ -133,15 +143,6 @@ if(ANDROID OR IOS OR ARMLINUX) "Disable RDMA when cross-compiling for Android and iOS" FORCE) set(WITH_MKL OFF CACHE STRING "Disable MKL when cross-compiling for Android and iOS" FORCE) - - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Default use Release in android" FORCE) - endif() - if(NOT THIRD_PARTY_BUILD_TYPE) - set(THIRD_PARTY_BUILD_TYPE "MinSizeRel" CACHE STRING - "Default use MinSizeRel in android" FORCE) - endif() endif() # for lite, both server and mobile framework. diff --git a/paddle/fluid/lite/core/mir/CMakeLists.txt b/paddle/fluid/lite/core/mir/CMakeLists.txt index 2fa3e39db10d84637ffa277d179278016a7cc60d..021758de4738d56976cdb5ddcd74e53850fdb354 100644 --- a/paddle/fluid/lite/core/mir/CMakeLists.txt +++ b/paddle/fluid/lite/core/mir/CMakeLists.txt @@ -52,8 +52,11 @@ cc_library(mir_passes # X86_DEPS mul_compute_x86 # ) - -lite_cc_library(pattern_matcher_lite SRCS pattern_matcher.cc DEPS mir_node mir_ssa_graph op_lite) +set(pattern_deps mir_node mir_ssa_graph op_lite) +if (WITH_TESTING) + list(APPEND pattern_deps gtest) +endif() +lite_cc_library(pattern_matcher_lite SRCS pattern_matcher.cc DEPS ${pattern_deps}) lite_cc_test(test_pattern_matcher_lite SRCS pattern_matcher_test.cc DEPS pattern_matcher_lite) lite_cc_library(pattern_matcher_high_api SRCS pattern_matcher_high_api.cc DEPS pattern_matcher_lite)