Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
736af1f1
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
736af1f1
编写于
6月 26, 2017
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FIX: go get dependencies automatically
上级
09a50cb9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
13 deletion
+18
-13
cmake/generic.cmake
cmake/generic.cmake
+17
-8
go/pserver/cclient/CMakeLists.txt
go/pserver/cclient/CMakeLists.txt
+1
-5
未找到文件。
cmake/generic.cmake
浏览文件 @
736af1f1
...
...
@@ -246,6 +246,7 @@ endfunction(nv_test)
set
(
GOPATH
"
${
CMAKE_CURRENT_BINARY_DIR
}
/go"
)
file
(
MAKE_DIRECTORY
${
GOPATH
}
)
set
(
PADDLE_IN_GOPATH
"
${
GOPATH
}
/src/github.com/PaddlePaddle/Paddle"
)
# Because api.go defines a GO wrapper to ops and tensor, it depends on
# both. This implies that if any of tensor.{h,cc}, ops.{h,cu}, or
...
...
@@ -270,14 +271,29 @@ function(go_library TARGET_NAME)
set
(
LIB_NAME
"
${
CMAKE_STATIC_LIBRARY_PREFIX
}${
TARGET_NAME
}${
CMAKE_STATIC_LIBRARY_SUFFIX
}
"
)
endif
()
# Add dummy code to support `make target_name` under Terminal Command
set
(
dummyfile
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
_dummy.c
)
file
(
WRITE
${
dummyfile
}
"const char * dummy =
\"
${
dummyfile
}
\"
;"
)
add_library
(
${
TARGET_NAME
}
STATIC
${
dummyfile
}
)
add_dependencies
(
${
TARGET_NAME
}
${
go_library_DEPS
}
)
if
(
go_library_DEPS
)
add_dependencies
(
${
TARGET_NAME
}
${
go_library_DEPS
}
)
endif
(
go_library_DEPS
)
# we need to symlink Paddle directory into GOPATH. If we
# don't do it and we have code that depends on Paddle, go
# get ./... will download a new Paddle repo from Github,
# without the changes in our current Paddle repo that we
# want to build.
file
(
GLOB GO_SOURCE RELATIVE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"*.go"
)
add_custom_command
(
TARGET
${
TARGET_NAME
}
POST_BUILD
COMMAND rm
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
LIB_NAME
}
"
# Symlink Paddle directory into GOPATH
COMMAND mkdir -p
${
PADDLE_IN_GOPATH
}
COMMAND rm -rf
${
PADDLE_IN_GOPATH
}
COMMAND ln -sf
${
CMAKE_SOURCE_DIR
}
${
PADDLE_IN_GOPATH
}
# Automatically get all dependencies specified in the source code
COMMAND env GOPATH=
${
GOPATH
}
${
CMAKE_Go_COMPILER
}
get -d .
# Golang build source code
COMMAND env GOPATH=
${
GOPATH
}
${
CMAKE_Go_COMPILER
}
build
${
BUILD_MODE
}
-o
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
LIB_NAME
}
"
${
GO_SOURCE
}
...
...
@@ -311,10 +327,3 @@ function(go_test TARGET_NAME)
add_custom_target
(
${
TARGET_NAME
}
ALL DEPENDS
${
TARGET_NAME
}
_timestamp
${
go_test_DEPS
}
)
add_test
(
${
TARGET_NAME
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
)
endfunction
(
go_test
)
# go_extern will download extern go project.
# go_extern(target_name extern_source)
# go_extern(go_redis github.com/hoisie/redis)
function
(
go_extern TARGET_NAME
)
add_custom_target
(
${
TARGET_NAME
}
env GOPATH=
${
GOPATH
}
${
CMAKE_Go_COMPILER
}
get -d
${
ARGN
}
)
endfunction
(
go_extern
)
go/pserver/cclient/CMakeLists.txt
浏览文件 @
736af1f1
file
(
RELATIVE_PATH rel
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
)
go_extern
(
go_pserver
${
rel
}
/...
)
go_extern
(
go_logrus github.com/sirupsen/logrus
)
go_library
(
paddle_pserver_cclient STATIC DEPS go_logrus go_pserver
)
go_library
(
paddle_pserver_cclient STATIC
)
add_subdirectory
(
test
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录