diff --git a/CMakeLists.txt b/CMakeLists.txt index ec4e6e2e868039e3367dd7d504cf698c410e9b9a..70b35154aaf1fa4d013fa8c23913db9dff9c4082 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,9 +168,11 @@ endif(USE_NNPACK) add_subdirectory(proto) -# "add_subdirectory(go)" should be placed after the following loine, -# because it depends on paddle/optimizer. -add_subdirectory(paddle/optimizer) +if(NOT MOBILE_INFERENCE) + # "add_subdirectory(go)" should be placed after the following loine, + # because it depends on paddle/optimizer. + add_subdirectory(paddle/optimizer) +endif() # "add_subdirectory(paddle)" and "add_subdirectory(python)" should be # placed after this block, because they depends on it. diff --git a/cmake/util.cmake b/cmake/util.cmake index 45a8d66120806d668fa110c89ac776c5d7bb49d9..2ab1e8c8e4f4aabbbc893e6fefad841897778913 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -83,7 +83,6 @@ function(link_paddle_exe TARGET_NAME) paddle_utils paddle_parameter paddle_proto - paddle_optimizer ${EXTERNAL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}