equal
deleted
inserted
replaced
3 # All rights reserved. |
3 # All rights reserved. |
4 # |
4 # |
5 # This software may be modified and distributed under the terms |
5 # This software may be modified and distributed under the terms |
6 # of the BSD license. See the LICENSE file for details. |
6 # of the BSD license. See the LICENSE file for details. |
7 |
7 |
|
8 import sys |
8 from setuptools import setup |
9 from setuptools import setup |
9 |
10 |
10 try: |
11 try: |
11 import cffi |
12 import cffi |
12 except ImportError: |
13 except ImportError: |
13 cffi = None |
14 cffi = None |
14 |
15 |
15 import setup_zstd |
16 import setup_zstd |
16 |
17 |
|
18 SUPPORT_LEGACY = False |
|
19 |
|
20 if "--legacy" in sys.argv: |
|
21 SUPPORT_LEGACY = True |
|
22 sys.argv.remove("--legacy") |
|
23 |
17 # Code for obtaining the Extension instance is in its own module to |
24 # Code for obtaining the Extension instance is in its own module to |
18 # facilitate reuse in other projects. |
25 # facilitate reuse in other projects. |
19 extensions = [setup_zstd.get_c_extension()] |
26 extensions = [setup_zstd.get_c_extension(SUPPORT_LEGACY, 'zstd')] |
20 |
27 |
21 if cffi: |
28 if cffi: |
22 import make_cffi |
29 import make_cffi |
23 extensions.append(make_cffi.ffi.distutils_extension()) |
30 extensions.append(make_cffi.ffi.distutils_extension()) |
24 |
31 |