gracefully skip C extension if it can't be built
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@274 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
675d6c3fc9
commit
059cbe3cfb
15
setup.py
15
setup.py
@ -2,6 +2,7 @@
|
||||
|
||||
import os, sys
|
||||
from distutils.core import setup, Extension
|
||||
from distutils.command.build_ext import build_ext
|
||||
|
||||
|
||||
try:
|
||||
@ -17,6 +18,19 @@ except ImportError:
|
||||
print " http://sourceforge.net/projects/pyxml/"
|
||||
|
||||
|
||||
class build_ext_optional(build_ext):
|
||||
"""build_ext command which doesn't abort when it fails."""
|
||||
def build_extension(self, ext):
|
||||
# Skip extensions which cannot be built
|
||||
try:
|
||||
build_ext.build_extension(self, ext)
|
||||
except:
|
||||
self.announce(
|
||||
'*** WARNING: Building of extension "%s" '
|
||||
'failed: %s' %
|
||||
(ext.name, sys.exc_info()[1]))
|
||||
|
||||
|
||||
setup(
|
||||
name = "FontTools",
|
||||
version = "1.0",
|
||||
@ -49,5 +63,6 @@ setup(
|
||||
)
|
||||
],
|
||||
scripts = ["Tools/ttcompile", "Tools/ttdump", "Tools/ttlist"],
|
||||
cmdclass = {"build_ext": build_ext_optional}
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user