Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
bbcaaffd
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bbcaaffd
编写于
6月 29, 2023
作者:
Z
Zhenghai Zhang
提交者:
GitHub
6月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle][CINN] fix cinn codestyle cmake-lint (#54975)
上级
2e6de4ce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
cmake/cinn/core.cmake
cmake/cinn/core.cmake
+15
-15
未找到文件。
cmake/cinn/core.cmake
浏览文件 @
bbcaaffd
...
...
@@ -32,7 +32,7 @@ function(cinn_cc_library TARGET_NAME)
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
source
}
.h
)
endif
()
endforeach
()
else
(
cinn_cc_library_SRCS
)
else
()
if
(
cinn_cc_library_DEPS
)
cinn_merge_static_libs
(
${
TARGET_NAME
}
${
cinn_cc_library_DEPS
}
)
else
()
...
...
@@ -41,7 +41,7 @@ function(cinn_cc_library TARGET_NAME)
"Please specify source files or libraries in cinn_cc_library(
${
TARGET_NAME
}
...)."
)
endif
()
endif
(
cinn_cc_library_SRCS
)
endif
()
if
((
NOT
(
"
${
TARGET_NAME
}
"
STREQUAL
"cinn_gtest_main"
))
AND
(
NOT
(
"
${
TARGET_NAME
}
"
STREQUAL
"utils"
))
...
...
@@ -52,7 +52,7 @@ function(cinn_cc_library TARGET_NAME)
(
NOT
(
"
${
TARGET_NAME
}
"
STREQUAL
"cinn_gtest_main"
))
AND
(
NOT
(
"
${
TARGET_NAME
}
"
STREQUAL
"utils"
))
AND
(
NOT
(
"
${
TARGET_NAME
}
"
STREQUAL
"lib"
)))
endfunction
(
cinn_cc_library
)
endfunction
()
list
(
APPEND CMAKE_CTEST_ARGUMENTS
)
...
...
@@ -116,17 +116,17 @@ function(cinn_nv_library TARGET_NAME)
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
source
}
.h
)
endif
()
endforeach
()
else
(
cinn_nv_library_SRCS
)
else
()
if
(
cinn_nv_library_DEPS
)
cinn_merge_static_libs
(
${
TARGET_NAME
}
${
cinn_nv_library_DEPS
}
)
else
()
message
(
FATAL
"Please specify source file or library in cinn_nv_library."
)
endif
()
endif
(
cinn_nv_library_SRCS
)
endif
()
target_link_libraries
(
${
TARGET_NAME
}
Threads::Threads
)
endif
()
endfunction
(
cinn_nv_library
)
endfunction
()
function
(
cinn_nv_binary TARGET_NAME
)
if
(
WITH_GPU
)
...
...
@@ -142,7 +142,7 @@ function(cinn_nv_binary TARGET_NAME)
common_link
(
${
TARGET_NAME
}
)
endif
()
endif
()
endfunction
(
cinn_nv_binary
)
endfunction
()
function
(
cinn_nv_test TARGET_NAME
)
if
(
WITH_GPU
...
...
@@ -184,7 +184,7 @@ function(cinn_nv_test TARGET_NAME)
endif
()
remove_gflags
(
${
TARGET_NAME
}
)
endif
()
endfunction
(
cinn_nv_test
)
endfunction
()
# Add dependency that TARGET will depend on test result of DEP, this function executes the DEP during make.
function
(
add_run_test_dependency TARGET_NAME DEP_NAME
)
...
...
@@ -198,8 +198,8 @@ function(add_run_test_dependency TARGET_NAME DEP_NAME)
COMMAND cd
${
CMAKE_BINARY_DIR
}
DEPENDS
${
DEP_NAME
}
)
add_dependencies
(
${
TARGET_NAME
}
${
DEP_NAME
}
${
custom_target_name
}
)
endif
(
WITH_TESTING AND CINN_ONLY
)
endfunction
(
add_run_test_dependency
)
endif
()
endfunction
()
# find all third_party modules is used for paddle static library
# for reduce the dependency when building the inference libs.
...
...
@@ -214,7 +214,7 @@ function(find_fluid_thirdparties TARGET_NAME)
set
(
fluid_third_partys
${
fluid_third_partys
}
${
TARGET_NAME
}
)
set_property
(
GLOBAL PROPERTY FLUID_THIRD_PARTY
"
${
fluid_third_partys
}
"
)
endif
()
endfunction
(
find_fluid_thirdparties
)
endfunction
()
function
(
cinn_merge_static_libs TARGET_NAME
)
set
(
libs
${
ARGN
}
)
...
...
@@ -258,7 +258,7 @@ function(cinn_merge_static_libs TARGET_NAME)
COMMAND rm
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lib
${
TARGET_NAME
}
.a"
COMMAND /usr/bin/libtool -static -o
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lib
${
TARGET_NAME
}
.a"
${
libfiles
}
)
endif
(
APPLE
)
endif
()
if
(
LINUX
)
# general UNIX: use "ar" to extract objects and re-add to a common lib
set
(
target_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
TARGET_NAME
}
.dir
)
...
...
@@ -306,7 +306,7 @@ function(cinn_merge_static_libs TARGET_NAME)
COMMAND
${
CMAKE_AR
}
crs
${
target_LIBNAME
}
`find
${
target_DIR
}
-name '*.o'`
COMMAND
${
CMAKE_RANLIB
}
${
target_LIBNAME
}
WORKING_DIRECTORY
${
target_DIR
}
)
endif
(
LINUX
)
endif
()
if
(
WIN32
)
# windows do not support gcc/nvcc combined compiling. Use msvc lib.exe to merge libs.
...
...
@@ -339,8 +339,8 @@ function(cinn_merge_static_libs TARGET_NAME)
lib
/OUT:
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_BUILD_TYPE
}
/lib
${
TARGET_NAME
}
.lib
${
libfiles
}
)
endif
(
WIN32
)
endfunction
(
cinn_merge_static_libs
)
endif
()
endfunction
()
# Modification of standard 'protobuf_generate_cpp()' with protobuf-lite support
# Usage:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录