Skip to content

Commit e6e2bf4

Browse files
authored
Merge pull request #2832 from helinwang/go_cmake
go_binary: remove hardcoded library link path, add pserver client test
2 parents 19bfb8a + b04986d commit e6e2bf4

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

cmake/generic.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,11 @@ function(go_binary TARGET_NAME)
320320
cmake_parse_arguments(go_binary "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
321321
string(REPLACE "${PADDLE_GO_PATH}/" "" CMAKE_CURRENT_SOURCE_REL_DIR ${CMAKE_CURRENT_SOURCE_DIR})
322322

323-
# FIXME: link path
324323
add_custom_command(OUTPUT ${TARGET_NAME}_timestamp
325-
COMMAND env LIBRARY_PATH=${CMAKE_BINARY_DIR}/go/pserver/client/c/:$ENV{LIBRARY_PATH}
326-
GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build
324+
COMMAND env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build
327325
-o "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}"
328326
"./${CMAKE_CURRENT_SOURCE_REL_DIR}/${go_binary_SRCS}"
329327
WORKING_DIRECTORY "${PADDLE_IN_GOPATH}/go")
330-
# TODO: don't know what ${TARGET_NAME}_link does
331328
add_custom_target(${TARGET_NAME} ALL DEPENDS go_vendor ${TARGET_NAME}_timestamp ${go_binary_DEPS})
332329
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME} DESTINATION bin)
333330
endfunction(go_binary)

go/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ add_subdirectory(cmd/master)
1919
add_subdirectory(master/c)
2020
add_subdirectory(master)
2121
add_subdirectory(pserver)
22+
add_subdirectory(pserver/client)
2223
add_subdirectory(utils/networkhelper)

go/cmd/master/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
go_binary(master SRC master.go DEPS paddle_go_optimizer)
15+
go_binary(master SRC master.go)

go/pserver/client/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if(WITH_TESTING)
2+
go_test(pserver_client_test DEPS paddle_go_optimizer)
3+
endif()

0 commit comments

Comments
 (0)