-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
90 lines (79 loc) · 3.16 KB
/
setup.py
File metadata and controls
90 lines (79 loc) · 3.16 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import setuptools
from distutils.core import setup
from distutils.core import Extension
from distutils.command.install import install
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.sysconfig import get_config_vars
import subprocess
import shutil
import glob
import os
import sys
class build_ext_subclass( build_ext ):
def build_extensions(self):
self.compiler.define_macro("PYTHON_MAJOR_VERSION", sys.version_info[0])
print("Testing for std::tr1::shared_ptr...")
try:
self.compiler.compile(['test_std_tr1_shared_ptr.cpp'])
self.compiler.define_macro("HAVE_STD_TR1_SHARED_PTR")
print("...found")
except:
print(" ...not found")
print("Testing for std::shared_ptr...")
try:
self.compiler.compile(['test_std_shared_ptr.cpp'],
extra_preargs=['-std=c++0x']),
self.compiler.define_macro("HAVE_STD_SHARED_PTR")
print("...found")
except:
print("...not found")
print("Testing for std::unique_ptr...")
try:
self.compiler.compile(['test_std_unique_ptr.cpp'],
extra_preargs=['-std=c++0x']),
self.compiler.define_macro("HAVE_STD_UNIQUE_PTR")
print("...found")
except:
print("...not found")
build_ext.build_extensions(self)
# Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++.
import distutils.sysconfig
cfg_vars = distutils.sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = value.replace("-Wstrict-prototypes", "")
long_description=''
with open('LICENSE') as file:
license = file.read()
if sys.version_info[0] == 2:
extra_compile_args=['/EHsc', '/DHAVE_STD_TR1_SHARED_PTR',
'/DPYTHON_MAJOR_VERSION=2']
else:
extra_compile_args=['/EHsc', '/DHAVE_STD_SHARED_PTR',
'/DPYTHON_MAJOR_VERSION=3']
setup(
name='quickfix',
version='1.15.1',
py_modules=['quickfix', 'quickfixt11', 'quickfix40', 'quickfix41',
'quickfix42', 'quickfix43', 'quickfix44', 'quickfix50',
'quickfix50sp1', 'quickfix50sp2'],
data_files=[('share/quickfix', glob.glob('spec/FIX*.xml'))],
author='Oren Miller',
author_email='oren@quickfixengine.org',
maintainer='Oren Miller',
maintainer_email='oren@quickfixengine.org',
description="FIX (Financial Information eXchange) protocol implementation",
url='http://www.quickfixengine.org',
download_url='http://www.quickfixengine.org',
license=license,
# cmdclass = {'build_ext': build_ext_subclass },
ext_modules=[
Extension('_quickfix', list(glob.glob('C++/*.cpp')),
include_dirs=['C++'],
libraries=['Ws2_32', 'odbc32', 'odbccp32', 'kernel32',
'advapi32', 'wsock32'],
extra_compile_args=extra_compile_args
)
],
)