forked from arindam-m/pyslapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (40 loc) · 1.75 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
42
43
44
45
46
47
48
49
50
# <pep8-80 compliant>
# -*- coding: utf-8 -*-
__author__ = 'Martijn Berger'
import platform
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
if platform.system() == 'Linux':
libraries = ["SketchUpAPI"]
extra_compile_args = []
extra_link_args = ['-Lbinaries/sketchup/x86-64']
elif platform.system() == 'Darwin': # OS X
libraries = []
extra_compile_args = ['-mmacosx-version-min=10.9', '-F.']
extra_link_args = ['-mmacosx-version-min=10.9',
'-F',
'.',
'-framework',
'SketchUpAPI']
else:
libraries = ["SketchUpAPI"]
extra_compile_args = ['/Zp8']
extra_link_args = ['/LIBPATH:binaries/sketchup/x64/']
ext_modules = [
Extension("sketchup", # name of extension
["sketchup.pyx"], # filename of our Pyrex/Cython source
language="c++", # this causes Pyrex/Cython to create C++ source
include_dirs=["headers"], # usual stuff
libraries=libraries, # ditto
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
# embedsignature=True,
)]
for e in ext_modules:
e.cython_directives = {'language_level': "3"} # all are Python-3
setup(name="Sketchup",
cmdclass={"build_ext": build_ext},
ext_modules=ext_modules)
# install_name_tool -change "@rpath/SketchUpAPI.framework/Versions/Current/SketchUpAPI" "@loader_path/SketchUpAPI.framework/Versions/Current/SketchUpAPI" sketchup.so
# install_name_tool -change "@rpath/SketchUpAPI.framework/Versions/A/SketchUpAPI" "@loader_path/SketchUpAPI.framework/Versions/A/SketchUpAPI" sketchup.cpython-35m-darwin.so