Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
00806149
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
00806149
编写于
1月 19, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
1月 19, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve avoiding C++ linkage, definition creation and cmake tests (#710)
上级
9b693212
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
72 addition
and
45 deletion
+72
-45
.circleci/config.yml
.circleci/config.yml
+2
-2
CMakeLists.txt
CMakeLists.txt
+26
-20
configure.ac
configure.ac
+3
-0
src/Makefile.am
src/Makefile.am
+2
-9
src/check-defs.sh
src/check-defs.sh
+23
-14
src/gen-def.py
src/gen-def.py
+16
-0
未找到文件。
.circleci/config.yml
浏览文件 @
00806149
...
...
@@ -25,7 +25,7 @@ jobs:
-
image
:
base/devel
steps
:
-
checkout
-
run
:
pacman --noconfirm -Syu freetype2 cairo icu gettext gobject-introspection gcc gcc-libs glib2 graphite pkg-config ragel
-
run
:
pacman --noconfirm -Syu freetype2 cairo icu gettext gobject-introspection gcc gcc-libs glib2 graphite pkg-config ragel
python
-
run
:
./autogen.sh --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2
-
run
:
make && (make check || (cat `find -name '*.log'` &&
false
))
...
...
@@ -34,7 +34,7 @@ jobs:
-
image
:
fedora
steps
:
-
checkout
-
run
:
dnf install -y pkg-config ragel gcc gcc-c++ automake autoconf libtool make which glib2-devel freetype-devel cairo-devel libicu-devel gobject-introspection-devel graphite2-devel redhat-rpm-config ||
true
-
run
:
dnf install -y pkg-config ragel gcc gcc-c++ automake autoconf libtool make which glib2-devel freetype-devel cairo-devel libicu-devel gobject-introspection-devel graphite2-devel redhat-rpm-config
python
||
true
-
run
:
NOCONFIGURE=1 ./autogen.sh --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2
-
run
:
mkdir build && cd build && ../configure && make && (make check || (cat `find -name '*.log'` &&
false
))
...
...
CMakeLists.txt
浏览文件 @
00806149
...
...
@@ -127,7 +127,7 @@ if (BUILD_SHARED_LIBS)
add_definitions
(
"-DHB_EXTERN=__declspec(dllexport) extern"
)
else
()
set
(
CMAKE_CXX_FLAGS
"-fvisibility=hidden
${
CMAKE_CXX_FLAGS
}
"
)
set
(
CMAKE_C_FLAGS
"-fvisibility=hidden
${
CMAKE_C
XX
_FLAGS
}
"
)
set
(
CMAKE_C_FLAGS
"-fvisibility=hidden
${
CMAKE_C_FLAGS
}
"
)
add_definitions
(
"-DHB_EXTERN=__attribute__((visibility(
\"
default
\"
))) extern"
)
endif
()
endif
()
...
...
@@ -524,11 +524,19 @@ if (UNIX OR MINGW)
link_libraries
(
-Bsymbolic-functions
)
# Make sure we don't link to libstdc++
set
(
CMAKE_CXX_FLAGS
"-fno-rtti -fno-exceptions
${
CMAKE_CXX_FLAGS
}
"
)
if
(
NOT APPLE
)
set
(
CMAKE_CXX_IMPLICIT_LINK_LIBRARIES
""
)
set
(
CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
""
)
set_target_properties
(
harfbuzz PROPERTIES LINKER_LANGUAGE C
)
if
(
BUILD_SHARED_LIBS
AND
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
))
set
(
CMAKE_CXX_FLAGS
"-fno-rtti -fno-exceptions
${
CMAKE_CXX_FLAGS
}
"
)
endif
()
set
(
CMAKE_CXX_IMPLICIT_LINK_LIBRARIES
""
)
set
(
CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
""
)
set_target_properties
(
harfbuzz PROPERTIES LINKER_LANGUAGE C
)
# No threadsafe statics as we do it ourselves
if
(
BUILD_SHARED_LIBS
)
set
(
CMAKE_CXX_FLAGS
"-fno-threadsafe-statics
${
CMAKE_CXX_FLAGS
}
"
)
endif
()
endif
()
...
...
@@ -782,22 +790,20 @@ endif ()
## Tests
if
(
UNIX OR MINGW
)
if
(
BUILD_SHARED_LIBS
)
# does some "make" stuff inside
#add_test(NAME check-defs.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-defs.sh)
#set_tests_properties(check-defs.sh PROPERTIES ENVIRONMENT "libs=.")
string
(
REPLACE
";"
" "
space_separated_headers
"
${
project_headers
}
"
)
add_custom_command
(
TARGET harfbuzz POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E env
"headers=
${
space_separated_headers
}
"
python
${
PROJECT_SOURCE_DIR
}
/src/gen-def.py
${
PROJECT_BINARY_DIR
}
/harfbuzz.def
WORKING_DIRECTORY
${
PROJECT_SOURCE_DIR
}
/src
)
add_test
(
NAME check-symbols.sh COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-symbols.sh
)
set_tests_properties
(
check-symbols.sh PROPERTIES ENVIRONMENT
"libs=."
)
if
(
NOT APPLE
)
add_test
(
NAME check-libstdc++.sh COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-libstdc++.sh
)
add_test
(
NAME check-static-inits.sh
COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-static-inits.sh
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/CMakeFiles/harfbuzz.dir/src
# ugly hack
)
set_tests_properties
(
check-libstdc++.sh check-static-inits.sh
PROPERTIES ENVIRONMENT
"libs=."
)
endif
()
add_test
(
NAME check-static-inits.sh
COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-static-inits.sh
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/harfbuzz.dir/src
# ugly hack
)
add_test
(
NAME check-libstdc++.sh COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-libstdc++.sh
)
add_test
(
NAME check-defs.sh COMMAND
${
PROJECT_SOURCE_DIR
}
/src/check-defs.sh
)
set_tests_properties
(
check-symbols.sh check-static-inits.sh check-libstdc++.sh check-defs.sh
PROPERTIES ENVIRONMENT
"libs=.;srcdir=
${
PROJECT_SOURCE_DIR
}
/src"
)
endif
()
add_test
(
NAME check-c-linkage-decls.sh COMMAND ./check-c-linkage-decls.sh
)
...
...
configure.ac
浏览文件 @
00806149
...
...
@@ -83,6 +83,9 @@ if test "x$GCC" = "xyes"; then
# Make sure we don't link to libstdc++
CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
# No threadsafe statics and C++ as we do it ourselves
CXXFLAGS="$CXXFLAGS -fno-threadsafe-statics"
# Assorted warnings
CXXFLAGS="$CXXFLAGS -Wcast-align"
...
...
src/Makefile.am
浏览文件 @
00806149
...
...
@@ -223,21 +223,14 @@ CLEANFILES += $(pkgconfig_DATA)
CLEANFILES
+=
harfbuzz.def
harfbuzz.def
:
$(HBHEADERS) $(HBNODISTHEADERS)
$(AM_V_GEN)
(
echo
EXPORTS
;
\
(
cat
$^
||
echo
'hb_ERROR ()'
)
|
\
$(EGREP)
'^hb_.* \('
|
\
sed
-e
's/ (.*//'
|
\
LC_ALL
=
C
sort
;
\
echo
LIBRARY libharfbuzz-0.dll
;
\
)
>
"
$@
"
@
!
grep
-q
hb_ERROR
"
$@
"
\
||
(
$(RM)
"
$@
"
;
false
)
$(AM_V_GEN)
headers
=
"
$^
"
$(srcdir)
/gen-def.py
$@
GENERATORS
=
\
gen-arabic-table.py
\
gen-indic-table.py
\
gen-use-table.py
\
gen-def.py
\
$(NULL)
EXTRA_DIST
+=
$(GENERATORS)
...
...
src/check-defs.sh
浏览文件 @
00806149
...
...
@@ -5,7 +5,6 @@ export LC_ALL
test
-z
"
$srcdir
"
&&
srcdir
=
.
test
-z
"
$libs
"
&&
libs
=
.libs
test
-z
"
$MAKE
"
&&
MAKE
=
make
stat
=
0
if
which nm 2>/dev/null
>
/dev/null
;
then
...
...
@@ -16,26 +15,36 @@ else
fi
defs
=
"harfbuzz.def"
$MAKE
$defs
>
/dev/null
if
!
test
-f
"
$defs
"
;
then
echo
"check-defs.sh: '
$defs
' not found; skipping test"
exit
77
fi
tested
=
false
for
def
in
$defs
;
do
lib
=
`
echo
"
$def
"
|
sed
's/[.]def$//;s@.*/@@'
`
so
=
$libs
/lib
${
lib
}
.so
for
suffix
in
so dylib
;
do
so
=
$libs
/lib
${
lib
}
.
$suffix
if
!
test
-f
"
$so
"
;
then continue
;
fi
EXPORTED_SYMBOLS
=
"
`
nm
"
$so
"
|
grep
' [BCDGINRSTVW] .'
|
grep
-v
' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| _fbss\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>\| __gcov_flush\>\| llvm_'
|
cut
-d
' '
-f3
`
"
EXPORTED_SYMBOLS
=
"
`
nm
"
$so
"
|
grep
' [BCDGINRSTVW] .'
|
grep
-v
' _fini\>\| _init\>\| _fdata\>\| _ftext\>\| _fbss\>\| __bss_start\>\| __bss_start__\>\| __bss_end__\>\| _edata\>\| _end\>\| _bss_end__\>\| __end__\>\| __gcov_flush\>\| llvm_'
|
cut
-d
' '
-f3
`
"
# On mac, C symbols are prefixed with _
if
test
$suffix
=
dylib
;
then
prefix
=
"_"
;
fi
if
test
-f
"
$so
"
;
then
if
test
-f
"
$so
"
;
then
echo
"Checking that
$so
has the same symbol list as
$def
"
{
echo
EXPORTS
echo
"
$EXPORTED_SYMBOLS
"
# cheat: copy the last line from the def file!
tail
-n1
"
$def
"
}
| diff
"
$def
"
-
>
&2
||
stat
=
1
echo
"Checking that
$so
has the same symbol list as
$def
"
{
echo
EXPORTS
echo
"
$EXPORTED_SYMBOLS
"
|
sed
-e
"s/^
${
prefix
}
hb/hb/g
"
# cheat: copy the last line from the def file!
tail
-n1
"
$def
"
}
| diff
"
$def
"
-
>
&2
||
stat
=
1
tested
=
true
fi
tested
=
true
fi
done
done
if
!
$tested
;
then
echo
"check-defs.sh: libharfbuzz shared library not found; skipping test"
...
...
src/gen-def.py
0 → 100755
浏览文件 @
00806149
#!/usr/bin/env python
from
__future__
import
print_function
import
io
,
os
,
re
,
sys
headers_content
=
[]
for
h
in
os
.
environ
[
"headers"
].
split
(
' '
):
if
h
.
endswith
(
".h"
):
with
io
.
open
(
h
,
encoding
=
'utf8'
)
as
f
:
headers_content
.
append
(
f
.
read
())
result
=
(
"EXPORTS
\n
"
+
"
\n
"
.
join
(
sorted
(
re
.
findall
(
r
"^hb_\w+(?= \()"
,
"
\n
"
.
join
(
headers_content
),
re
.
M
)))
+
"
\n
LIBRARY libharfbuzz-0.dll"
)
with
open
(
sys
.
argv
[
1
],
"w"
)
as
f
:
f
.
write
(
result
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录