|
29 | 29 | long_description = f.read() |
30 | 30 |
|
31 | 31 |
|
32 | | -cyclone = find_cyclonedds() |
| 32 | +if "BUILDING_SDIST" not in os.environ: |
| 33 | + cyclone = find_cyclonedds() |
33 | 34 |
|
34 | | -if not cyclone: |
35 | | - print("Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH") |
36 | | - import sys |
37 | | - sys.exit(1) |
| 35 | + if not cyclone: |
| 36 | + print("Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH") |
| 37 | + import sys |
| 38 | + sys.exit(1) |
38 | 39 |
|
39 | 40 |
|
40 | | -with open(this_directory / 'cyclonedds' / '__library__.py', "w", encoding='utf-8') as f: |
41 | | - f.write("in_wheel = False\n") |
42 | | - f.write(f"library_path = '{cyclone.ddsc_library}'") |
| 41 | + with open(this_directory / 'cyclonedds' / '__library__.py', "w", encoding='utf-8') as f: |
| 42 | + f.write("in_wheel = False\n") |
| 43 | + f.write(f"library_path = '{cyclone.ddsc_library}'") |
43 | 44 |
|
44 | 45 |
|
45 | | -ext_modules = [ |
46 | | - Extension('cyclonedds._clayer', [ |
47 | | - 'clayer/cdrkeyvm.c', |
48 | | - 'clayer/pysertype.c', |
49 | | - 'clayer/typeser.c' |
50 | | - ], |
51 | | - include_dirs=[ |
52 | | - str(cyclone.include_path), |
53 | | - str(this_directory / "clayer") |
54 | | - ], |
55 | | - libraries=['ddsc'], |
56 | | - library_dirs=[ |
57 | | - str(cyclone.library_path), |
58 | | - str(cyclone.binary_path), |
59 | | - ] |
60 | | - ) |
61 | | -] |
62 | | - |
63 | | -if cyclone.idlc_library: |
64 | | - ext_modules += [ |
65 | | - Library('cyclonedds._idlpy', [ |
66 | | - 'idlpy/src/context.c', |
67 | | - 'idlpy/src/generator.c', |
68 | | - 'idlpy/src/naming.c', |
69 | | - 'idlpy/src/ssos.c', |
70 | | - 'idlpy/src/types.c', |
71 | | - 'idlpy/src/util.c' |
| 46 | + ext_modules = [ |
| 47 | + Extension('cyclonedds._clayer', [ |
| 48 | + 'clayer/cdrkeyvm.c', |
| 49 | + 'clayer/pysertype.c', |
| 50 | + 'clayer/typeser.c' |
72 | 51 | ], |
73 | 52 | include_dirs=[ |
74 | 53 | str(cyclone.include_path), |
75 | | - str(this_directory / "idlpy" / "include") |
| 54 | + str(this_directory / "clayer") |
76 | 55 | ], |
77 | | - libraries=['ddsc', 'cycloneddsidl'], |
| 56 | + libraries=['ddsc'], |
78 | 57 | library_dirs=[ |
79 | 58 | str(cyclone.library_path), |
80 | | - str(cyclone.binary_path) |
| 59 | + str(cyclone.binary_path), |
81 | 60 | ] |
82 | 61 | ) |
83 | 62 | ] |
84 | 63 |
|
| 64 | + if cyclone.idlc_library: |
| 65 | + ext_modules += [ |
| 66 | + Library('cyclonedds._idlpy', [ |
| 67 | + 'idlpy/src/context.c', |
| 68 | + 'idlpy/src/generator.c', |
| 69 | + 'idlpy/src/naming.c', |
| 70 | + 'idlpy/src/ssos.c', |
| 71 | + 'idlpy/src/types.c', |
| 72 | + 'idlpy/src/util.c' |
| 73 | + ], |
| 74 | + include_dirs=[ |
| 75 | + str(cyclone.include_path), |
| 76 | + str(this_directory / "idlpy" / "include") |
| 77 | + ], |
| 78 | + libraries=['ddsc', 'cycloneddsidl'], |
| 79 | + library_dirs=[ |
| 80 | + str(cyclone.library_path), |
| 81 | + str(cyclone.binary_path) |
| 82 | + ] |
| 83 | + ) |
| 84 | + ] |
| 85 | +else: |
| 86 | + ext_modules=[] |
| 87 | + |
85 | 88 |
|
86 | 89 | setup( |
87 | 90 | name='cyclonedds', |
|
0 commit comments