Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
810db0c6
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 接近 3 年
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
810db0c6
编写于
4月 11, 2017
作者:
J
jiyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the static lib linking order issue on Linux
上级
704a3053
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
4 deletion
+15
-4
cmake/CMakeLists.txt
cmake/CMakeLists.txt
+11
-4
cmake/external/glog.cmake
cmake/external/glog.cmake
+2
-0
oneflow/common/proto_io.h
oneflow/common/proto_io.h
+2
-0
未找到文件。
cmake/CMakeLists.txt
浏览文件 @
810db0c6
...
...
@@ -20,7 +20,9 @@ option(oneflow_VERBOSE "Enable for verbose output" OFF)
if
(
NOT WIN32
)
# find_package(Threads)
# Threads: defines CMAKE_THREAD_LIBS_INIT and adds -pthread compile option
# for targets that link ${CMAKE_THREAD_LIBS_INIT}
find_package
(
Threads
)
endif
()
# Force to link static cxx runtime library
...
...
@@ -68,6 +70,8 @@ if(WIN32)
add_definitions
(
-DWIN32 -DOS_WIN -D_MBCS -DWIN64 -DWIN32_LEAN_AND_MEAN -DNOGDI -DPLATFORM_WINDOWS
)
add_definitions
(
/bigobj /nologo /EHsc /GF /FC /MP /Gm-
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/MP"
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-pthread"
)
endif
()
if
(
WIN32
)
...
...
@@ -85,13 +89,13 @@ include(grpc)
set
(
oneflow_EXTERNAL_LIBRARIES
${
ZLIB_STATIC_LIBRARIES
}
${
GFLAGS_STATIC_LIBRARIES
}
${
GLOG_STATIC_LIBRARIES
}
${
GFLAGS_STATIC_LIBRARIES
}
${
GOOGLETEST_STATIC_LIBRARIES
}
${
PROTOBUF_STATIC_LIBRARIES
}
${
GRPC_STATIC_LIBRARIES
}
)
list
(
APPEND ONEFLOW_LINKER_LIBS
${
oneflow_EXTERNAL_LIBRARIES
}
)
#
list(APPEND ONEFLOW_LINKER_LIBS ${oneflow_EXTERNAL_LIBRARIES})
set
(
oneflow_EXTERNAL_DEPENDENCIES
zlib_copy_headers_to_destination
...
...
@@ -128,6 +132,7 @@ include(proto2cpp)
file
(
GLOB_RECURSE oneflow_protos
RELATIVE
${
oneflow_src_dir
}
"
${
oneflow_src_dir
}
/*.proto"
)
RELATIVE_PROTOBUF_GENERATE_CPP
(
PROTO_SRCS PROTO_HDRS
${
oneflow_src_dir
}
${
oneflow_protos
}
)
...
...
@@ -179,11 +184,13 @@ add_library(of_ccobj ${oneflow_object_cc} ${oneflow_all_h})
add_dependencies
(
of_ccobj of_protoobj
)
list
(
APPEND ONEFLOW_LINKER_LIBS of_ccobj
)
message
(
STATUS
${
ONEFLOW_LINKER_LIBS
}
)
# build test
foreach
(
cc
${
oneflow_test_cc
}
)
get_filename_component
(
test_name
${
cc
}
NAME_WE
)
string
(
CONCAT test_exe_name
${
test_name
}
exe
)
add_executable
(
${
test_exe_name
}
${
cc
}
)
target_link_libraries
(
${
test_exe_name
}
${
ONEFLOW_LINKER_LIB
S
}
)
target_link_libraries
(
${
test_exe_name
}
PUBLIC
${
ONEFLOW_LINKER_LIBS
}
${
oneflow_EXTERNAL_LIBRARIE
S
}
)
add_test
(
NAME
${
test_name
}
COMMAND
${
test_exe_name
}
)
endforeach
()
cmake/external/glog.cmake
浏览文件 @
810db0c6
...
...
@@ -37,9 +37,11 @@ ExternalProject_Add(glog
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=
${
CMAKE_BUILD_TYPE
}
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_CXX_FLAGS:STRING=
${
CMAKE_CXX_FLAGS
}
-DCMAKE_CXX_FLAGS_DEBUG:STRING=
${
CMAKE_CXX_FLAGS_DEBUG
}
-DCMAKE_CXX_FLAGS_RELEASE:STRING=
${
CMAKE_CXX_FLAGS_RELEASE
}
-DBUILD_TESTING:BOOL=OFF
-DWITH_GFLAGS:BOOL=OFF
)
add_custom_target
(
glog_create_header_dir
...
...
oneflow/common/proto_io.h
浏览文件 @
810db0c6
#ifndef ONEFLOW_PROTO_IO_H_
#define ONEFLOW_PROTO_IO_H_
#ifdef _MSC_VER
#include <io.h>
#endif
#include <string>
#include "google/protobuf/message.h"
#include "google/protobuf/descriptor.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录