Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
c9cdc986
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c9cdc986
编写于
5月 17, 2017
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
detect golang in cmake
上级
39b91123
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
0 deletion
+60
-0
cmake/CMakeDetermineGoCompiler.cmake
cmake/CMakeDetermineGoCompiler.cmake
+44
-0
cmake/CMakeGoCompiler.cmake.in
cmake/CMakeGoCompiler.cmake.in
+8
-0
cmake/CMakeGoInformation.cmake
cmake/CMakeGoInformation.cmake
+7
-0
cmake/CMakeTestGoCompiler.cmake
cmake/CMakeTestGoCompiler.cmake
+1
-0
未找到文件。
cmake/CMakeDetermineGoCompiler.cmake
0 → 100644
浏览文件 @
c9cdc986
if
(
NOT CMAKE_Go_COMPILER
)
if
(
NOT $ENV{GO_COMPILER} STREQUAL
""
)
get_filename_component
(
CMAKE_Go_COMPILER_INIT $ENV{GO_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Go_FLAGS_ENV_INIT
)
if
(
CMAKE_Go_FLAGS_ENV_INIT
)
set
(
CMAKE_Go_COMPILER_ARG1
"
${
CMAKE_Go_FLAGS_ENV_INIT
}
"
CACHE STRING
"First argument to Go compiler"
)
endif
()
if
(
NOT EXISTS
${
CMAKE_Go_COMPILER_INIT
}
)
message
(
SEND_ERROR
"Could not find compiler set in environment variable GO_COMPILER:
\n
$ENV{GO_COMPILER}."
)
endif
()
endif
()
set
(
Go_BIN_PATH
$ENV{GOPATH}
$ENV{GOROOT}
$ENV{GOROOT}/../bin
$ENV{GO_COMPILER}
/usr/bin
/usr/local/bin
)
if
(
CMAKE_Go_COMPILER_INIT
)
set
(
CMAKE_Go_COMPILER
${
CMAKE_Go_COMPILER_INIT
}
CACHE PATH
"Go Compiler"
)
else
()
find_program
(
CMAKE_Go_COMPILER
NAMES go
PATHS
${
Go_BIN_PATH
}
)
EXEC_PROGRAM
(
${
CMAKE_Go_COMPILER
}
ARGS version OUTPUT_VARIABLE GOLANG_VERSION
)
STRING
(
REGEX MATCH
"go[0-9]+.[0-9]+.[0-9]+[ /A-Za-z0-9]*"
VERSION
"
${
GOLANG_VERSION
}
"
)
message
(
"-- The Golang compiler identification is
${
VERSION
}
"
)
message
(
"-- Check for working Golang compiler:
${
CMAKE_Go_COMPILER
}
"
)
endif
()
endif
()
mark_as_advanced
(
CMAKE_Go_COMPILER
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/CMakeGoCompiler.cmake.in
${
CMAKE_PLATFORM_INFO_DIR
}
/CMakeGoCompiler.cmake @ONLY
)
set
(
CMAKE_Go_COMPILER_ENV_VAR
"GO_COMPILER"
)
cmake/CMakeGoCompiler.cmake.in
0 → 100644
浏览文件 @
c9cdc986
set(CMAKE_Go_COMPILER "@CMAKE_Go_COMPILER@")
set(CMAKE_Go_COMPILER_LOADED 1)
set(CMAKE_Go_SOURCE_FILE_EXTENSIONS go)
set(CMAKE_Go_LINKER_PREFERENCE 40)
set(CMAKE_Go_OUTPUT_EXTENSION .o)
set(CMAKE_Go_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_Go_COMPILER_ENV_VAR "GO_COMPILER")
cmake/CMakeGoInformation.cmake
0 → 100644
浏览文件 @
c9cdc986
if
(
NOT CMAKE_Go_COMPILE_OBJECT
)
set
(
CMAKE_Go_COMPILE_OBJECT
"go tool compile -l -N -o <OBJECT> <SOURCE> "
)
endif
()
if
(
NOT CMAKE_Go_LINK_EXECUTABLE
)
set
(
CMAKE_Go_LINK_EXECUTABLE
"go tool link -o <TARGET> <OBJECTS> "
)
endif
()
cmake/CMakeTestGoCompiler.cmake
0 → 100644
浏览文件 @
c9cdc986
set
(
CMAKE_Go_COMPILER_WORKS 1 CACHE INTERNAL
""
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录