mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Add build test for sfntly and remove unneccessary compiler flags on windows
This commit is contained in:
parent
8a08e13f73
commit
8cf35971ae
@ -45,9 +45,9 @@ class SfntlyBuilderMixin(object):
|
|||||||
if iswindows:
|
if iswindows:
|
||||||
self.sfntly_cflags += [
|
self.sfntly_cflags += [
|
||||||
'-D_UNICODE', '-DUNICODE',
|
'-D_UNICODE', '-DUNICODE',
|
||||||
] + shlex.split('/Zi /nologo /W4 /WX /O2 /Ob2 /Oy /GF /Gm- /MT /GS /Gy '
|
] + shlex.split('/W4 /WX /Gm- /Gy /GR-')
|
||||||
'/fp:precise /Zc:wchar_t /Zc:forScope /GR-')
|
|
||||||
else:
|
else:
|
||||||
|
# Possibly add -fno-inline (slower, but more robust)
|
||||||
self.sfntly_cflags += [
|
self.sfntly_cflags += [
|
||||||
'-Werror',
|
'-Werror',
|
||||||
'-fno-exceptions',
|
'-fno-exceptions',
|
||||||
@ -59,6 +59,11 @@ class SfntlyBuilderMixin(object):
|
|||||||
|
|
||||||
def __call__(self, obj_dir, compiler, linker, builder, cflags, ldflags):
|
def __call__(self, obj_dir, compiler, linker, builder, cflags, ldflags):
|
||||||
self.sfntly_build_dir = os.path.join(obj_dir, 'sfntly')
|
self.sfntly_build_dir = os.path.join(obj_dir, 'sfntly')
|
||||||
|
if '/Ox' in cflags:
|
||||||
|
cflags.remove('/Ox')
|
||||||
|
if '-O3' in cflags:
|
||||||
|
cflags.remove('-O3')
|
||||||
|
cflags.insert(0, '/O2' if iswindows else '-O2')
|
||||||
|
|
||||||
groups = []
|
groups = []
|
||||||
all_headers = set()
|
all_headers = set()
|
||||||
|
@ -37,6 +37,11 @@ def test_freetype():
|
|||||||
test()
|
test()
|
||||||
print ('FreeType OK!')
|
print ('FreeType OK!')
|
||||||
|
|
||||||
|
def test_sfntly():
|
||||||
|
from calibre.utils.fonts.subset import test
|
||||||
|
test()
|
||||||
|
print ('sfntly OK!')
|
||||||
|
|
||||||
def test_winutil():
|
def test_winutil():
|
||||||
from calibre.devices.scanner import win_pnp_drives
|
from calibre.devices.scanner import win_pnp_drives
|
||||||
matches = win_pnp_drives.scanner()
|
matches = win_pnp_drives.scanner()
|
||||||
@ -115,6 +120,7 @@ def test():
|
|||||||
test_plugins()
|
test_plugins()
|
||||||
test_lxml()
|
test_lxml()
|
||||||
test_freetype()
|
test_freetype()
|
||||||
|
test_sfntly()
|
||||||
test_sqlite()
|
test_sqlite()
|
||||||
test_qt()
|
test_qt()
|
||||||
test_imaging()
|
test_imaging()
|
||||||
|
@ -93,6 +93,11 @@ def test_mem():
|
|||||||
for i in xrange(3): gc.collect()
|
for i in xrange(3): gc.collect()
|
||||||
print ('Leaked memory per call:', (memory() - start_mem)/calls*1024, 'KB')
|
print ('Leaked memory per call:', (memory() - start_mem)/calls*1024, 'KB')
|
||||||
|
|
||||||
|
def test():
|
||||||
|
raw = P('fonts/liberation/LiberationSerif-Regular.ttf', data=True)
|
||||||
|
sf, old_stats, new_stats = subset(raw, set(('a', 'b', 'c')), ())
|
||||||
|
if len(sf) > 0.3 * len(raw):
|
||||||
|
raise Exception('Subsetting failed')
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
import sys, time
|
import sys, time
|
||||||
|
Loading…
x
Reference in New Issue
Block a user