Skip to content

Commit

Permalink
feat(cython): add cython empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
pine committed Aug 13, 2018
1 parent f381573 commit e0ce1b1
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 323 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Python
/build
/dist
/venv
Expand All @@ -7,10 +8,15 @@ __pycache__
*.egg-info
.eggs

# Pytest
.pytest_cache

# Cython
*.so
*.a
*.c

# example
*.png


76 changes: 39 additions & 37 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,52 @@
# -*- encoding: utf-8 -*-

import sys
from setuptools import setup, Extension
from setuptools import setup
from Cython.Build import cythonize

VERSION = '0.1.7'


extra_objects = [
'lib/libemoji.a',
]
extra_compile_args = [
'-std=c11',
'-Wall',
'-Wextra',
]
extra_link_args = []
libraries = []
# extra_objects = [
# 'lib/libemoji.a',
# ]
# extra_compile_args = [
# '-std=c11',
# '-Wall',
# '-Wextra',
# ]
# extra_link_args = []
# libraries = []

if sys.platform.startswith('darwin'):
extra_link_args.extend([
'-framework', 'CoreFoundation',
'-framework', 'CoreGraphics',
'-framework', 'CoreText',
'-framework', 'CoreServices',
])
elif sys.platform.startswith('linux'):
libraries.extend([
'dl',
'fontconfig',
'freetype',
'GL',
'GLU',
])
# if sys.platform.startswith('darwin'):
# extra_link_args.extend([
# '-framework', 'CoreFoundation',
# '-framework', 'CoreGraphics',
# '-framework', 'CoreText',
# '-framework', 'CoreServices',
# ])
# elif sys.platform.startswith('linux'):
# libraries.extend([
# 'dl',
# 'fontconfig',
# 'freetype',
# 'GL',
# 'GLU',
# ])


def main():
module = Extension(
'emojilib',
sources=['src/emojilib.c'],
include_dirs=['include'],
extra_objects=extra_objects,
libraries=libraries,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
language='c11'
)
# module = Extension(
# 'emojilib',
# sources=['src/emojilib.c'],
# include_dirs=['include'],
# extra_objects=extra_objects,
# libraries=libraries,
# extra_compile_args=extra_compile_args,
# extra_link_args=extra_link_args,
# language='c11'
# )
module = cythonize('src/emojilib.pyx')

setup(
name='emojilib',
Expand All @@ -65,7 +67,7 @@ def main():
],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
ext_modules=[module]
ext_modules=module
)


Expand Down
Loading

0 comments on commit e0ce1b1

Please sign in to comment.