Skip to content

Commit 5fc8824

Browse files
committed
Fix the compiling error when seting WITH_C_API=ON and WITH_PYTHON=ON.
1 parent e1b8c27 commit 5fc8824

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ if(ANDROID OR IOS)
8383
"Disable RDMA when cross-compiling for Android and iOS" FORCE)
8484
set(WITH_MKL OFF CACHE STRING
8585
"Disable MKL when cross-compiling for Android and iOS" FORCE)
86+
set(WITH_GOLANG OFF CACHE STRING
87+
"Disable golang when cross-compiling for Android and iOS" FORCE)
8688

8789
# Compile PaddlePaddle mobile inference library
8890
if (NOT WITH_C_API)

paddle/pserver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if(WITH_TESTING)
4949
add_subdirectory(test)
5050
endif()
5151

52-
if(NOT WITH_C_API)
52+
if(NOT MOBILE_INFERENCE)
5353
add_executable(paddle_pserver_main ${PSERVER_MAIN_SOURCES})
5454
link_paddle_exe(paddle_pserver_main)
5555

paddle/trainer/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if(WITH_TESTING)
5454
add_subdirectory(tests)
5555
endif()
5656

57-
if(NOT WITH_C_API)
57+
if(NOT MOBILE_INFERENCE)
5858
add_paddle_exe(paddle_trainer TrainerMain.cpp)
5959
add_paddle_exe(paddle_merge_model MergeModel.cpp)
6060

@@ -74,7 +74,5 @@ endif()
7474
if(WITH_GOLANG)
7575
add_dependencies(paddle_trainer_lib paddle_pserver_cclient)
7676
target_link_libraries(paddle_trainer_lib paddle_pserver_cclient)
77-
if(NOT WITH_C_API)
78-
target_link_libraries(paddle_trainer paddle_pserver_cclient)
79-
endif()
77+
target_link_libraries(paddle_trainer paddle_pserver_cclient)
8078
endif(WITH_GOLANG)

0 commit comments

Comments
 (0)