未验证 提交 fb919382 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #6088 from Xreki/fix_capi_build_with_python

Fix the compiling error when seting WITH_C_API=ON and WITH_PYTHON=ON.
...@@ -81,6 +81,8 @@ if(ANDROID OR IOS) ...@@ -81,6 +81,8 @@ if(ANDROID OR IOS)
"Disable RDMA when cross-compiling for Android and iOS" FORCE) "Disable RDMA when cross-compiling for Android and iOS" FORCE)
set(WITH_MKL OFF CACHE STRING set(WITH_MKL OFF CACHE STRING
"Disable MKL when cross-compiling for Android and iOS" FORCE) "Disable MKL when cross-compiling for Android and iOS" FORCE)
set(WITH_GOLANG OFF CACHE STRING
"Disable golang when cross-compiling for Android and iOS" FORCE)
# Compile PaddlePaddle mobile inference library # Compile PaddlePaddle mobile inference library
if (NOT WITH_C_API) if (NOT WITH_C_API)
......
...@@ -49,7 +49,7 @@ if(WITH_TESTING) ...@@ -49,7 +49,7 @@ if(WITH_TESTING)
add_subdirectory(test) add_subdirectory(test)
endif() endif()
if(NOT WITH_C_API) if(NOT MOBILE_INFERENCE)
add_executable(paddle_pserver_main ${PSERVER_MAIN_SOURCES}) add_executable(paddle_pserver_main ${PSERVER_MAIN_SOURCES})
link_paddle_exe(paddle_pserver_main) link_paddle_exe(paddle_pserver_main)
......
...@@ -54,7 +54,7 @@ if(WITH_TESTING) ...@@ -54,7 +54,7 @@ if(WITH_TESTING)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
if(NOT WITH_C_API) if(NOT MOBILE_INFERENCE)
add_paddle_exe(paddle_trainer TrainerMain.cpp) add_paddle_exe(paddle_trainer TrainerMain.cpp)
add_paddle_exe(paddle_merge_model MergeModel.cpp) add_paddle_exe(paddle_merge_model MergeModel.cpp)
...@@ -74,7 +74,5 @@ endif() ...@@ -74,7 +74,5 @@ endif()
if(WITH_GOLANG) if(WITH_GOLANG)
add_dependencies(paddle_trainer_lib paddle_pserver_cclient) add_dependencies(paddle_trainer_lib paddle_pserver_cclient)
target_link_libraries(paddle_trainer_lib paddle_pserver_cclient) target_link_libraries(paddle_trainer_lib paddle_pserver_cclient)
if(NOT WITH_C_API) target_link_libraries(paddle_trainer paddle_pserver_cclient)
target_link_libraries(paddle_trainer paddle_pserver_cclient)
endif()
endif(WITH_GOLANG) endif(WITH_GOLANG)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册