From 762e7781997ad6dffdb4f8600c86dc62f07ce8ff Mon Sep 17 00:00:00 2001 From: nanoric Date: Mon, 18 Feb 2019 22:39:23 -0400 Subject: [PATCH] [Add] setup.py: added linux support --- setup.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 43391004..a49ce40a 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,12 @@ +import platform + from setuptools import Extension, find_packages, setup +if platform.uname().system == "Windows": + compiler_flags = [] +else: + compiler_flags = ['-std=c++11', '-Wno-delete-incomplete'] + vnctpmd = Extension('vnpy.api.ctp.vnctpmd', [ "vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp", @@ -10,7 +17,7 @@ vnctpmd = Extension('vnpy.api.ctp.vnctpmd', library_dirs=["vnpy/api/ctp/libs"], libraries=["thostmduserapi", "thosttraderapi", ], # runtime_library_dirs=["vnpy/api/ctp/libs", ], - extra_compile_args=[], + extra_compile_args=compiler_flags, extra_link_args=[], depends=[], language="cpp", @@ -25,15 +32,22 @@ vnctptd = Extension('vnpy.api.ctp.vnctptd', library_dirs=["vnpy/api/ctp/libs"], libraries=["thostmduserapi", "thosttraderapi", ], # runtime_library_dirs=["vnpy/api/ctp/libs", ], - extra_compile_args=[], + extra_compile_args=compiler_flags, extra_link_args=[], depends=[], language="cpp", ) -setup( +pkgs = find_packages() + +s = setup( name="vnpy", version="2.0.dev0", - packages=find_packages(exclude=["tests", "tests.*", "*.tests.*"]), + include_package_data=True, + packages=pkgs, + package_data={'': [ + '*.json', '*.md', '*.ico', + '*.dll', '*.so', + ]}, ext_modules=[vnctptd, vnctpmd], )