/
setup.py
41 lines (36 loc) · 1.27 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from distutils.core import setup
from distutils.extension import Extension
import platform
from Cython.Build import cythonize
if platform.system() == 'Darwin':
includes = ['/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/']
f = '-framework'
link_args = [f, 'OpenGL']
libs = []
compile_args = ['-D FONTSTASH_IMPLEMENTATION','-D GLFONTSTASH_IMPLEMENTATION']
elif platform.system() == 'Windows':
includes = []
libs = ['OpenGL32']
link_args = []
compile_args = ['/DFONTSTASH_IMPLEMENTATION','/DGLFONTSTASH_IMPLEMENTATION'] # http://msdn.microsoft.com/de-de/library/hhzbb5c8.aspx
else:
includes = ['/usr/include/GL',]
libs = ['GL']
link_args = []
compile_args = ['-D FONTSTASH_IMPLEMENTATION','-D GLFONTSTASH_IMPLEMENTATION']
extensions = [
Extension( name="fontstash",
sources=['fontstash.pyx'],
include_dirs = includes + ['fontstash/src'],
libraries = libs,
extra_link_args=link_args,
extra_compile_args=compile_args)
]
#this package will be compiled into a single.so file.
setup( name="pyfontstash",
version="0.2",
author= 'Moritz Kassner',
license = 'MIT',
description="OpenGL font rendering. This module can also be used as a submodule for other cython projects that want to use OpenGL.",
ext_modules=cythonize(extensions)
)