|
13 | 13 | print("Please install Cython and try again.") |
14 | 14 | exit(1) |
15 | 15 |
|
| 16 | +SFML_HEADERS = os.getenv('SFML_HEADERS') |
| 17 | +SFML_LIBRARIES = os.getenv('SFML_LIBRARIES') |
| 18 | + |
16 | 19 | if platform.architecture()[0] == "32bit": |
17 | 20 | arch = "x86" |
18 | 21 | elif platform.architecture()[0] == "64bit": |
@@ -75,11 +78,24 @@ def cython_sources(self, sources, extension): |
75 | 78 |
|
76 | 79 | return ret |
77 | 80 |
|
| 81 | +include_dirs = [] |
| 82 | +library_dirs = [] |
| 83 | + |
| 84 | +include_dirs.append(os.path.join('include', 'Includes')) |
| 85 | +if SFML_HEADERS: |
| 86 | + include_dirs.append(SFML_HEADERS) |
| 87 | + |
| 88 | +if sys.hexversion >= 0x03050000: |
| 89 | + library_dirs.append(os.path.join('extlibs', 'libs-msvc-universal', arch)) |
| 90 | + |
| 91 | +if SFML_LIBRARIES: |
| 92 | + include_dirs.append(SFML_LIBRARIES) |
| 93 | + |
78 | 94 | def extension(name, files, libs): return Extension( |
79 | 95 | name='sfml.' + name, |
80 | 96 | sources=[os.path.join('src', 'sfml', name, filename) for filename in files], |
81 | | - include_dirs=[os.path.join('include', 'Includes')], |
82 | | - library_dirs=[os.path.join('extlibs', 'libs-msvc-universal', arch)] if sys.hexversion >= 0x03050000 else [], |
| 97 | + include_dirs=include_dirs, |
| 98 | + library_dirs=library_dirs, |
83 | 99 | language='c++', |
84 | 100 | libraries=libs, |
85 | 101 | define_macros=[('SFML_STATIC', '1')] if platform.system() == 'Windows' else [] |
|
0 commit comments