|
24 | 24 | import sys
|
25 | 25 | import subprocess
|
26 | 26 | import time
|
| 27 | +from pathlib import Path |
| 28 | + |
| 29 | +THIS_DIR = Path(__file__).resolve().parent |
| 30 | +REPO_ROOT = THIS_DIR.parent |
| 31 | + |
27 | 32 |
|
28 | 33 | RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
|
29 | 34 |
|
@@ -200,13 +205,13 @@ def build_unix():
|
200 | 205 |
|
201 | 206 | def build_windows():
|
202 | 207 | print("BUILDING FOR WINDOWS")
|
203 |
| - ffibuilder.cdef(open("raylib/raylib.h.modified").read()) |
| 208 | + ffibuilder.cdef((THIS_DIR / "raylib.h.modified").read_text()) |
204 | 209 | if RAYLIB_PLATFORM=="Desktop":
|
205 |
| - ffibuilder.cdef(open("raylib/glfw3.h.modified").read()) |
206 |
| - ffibuilder.cdef(open("raylib/rlgl.h.modified").read()) |
207 |
| - ffibuilder.cdef(open("raylib/raygui.h.modified").read()) |
208 |
| - ffibuilder.cdef(open("raylib/physac.h.modified").read()) |
209 |
| - ffibuilder.cdef(open("raylib/raymath.h.modified").read()) |
| 210 | + ffibuilder.cdef((THIS_DIR / "glfw3.h.modified").read_text()) |
| 211 | + ffibuilder.cdef((THIS_DIR / "rlgl.h.modified").read_text()) |
| 212 | + ffibuilder.cdef((THIS_DIR / "raygui.h.modified").read_text()) |
| 213 | + ffibuilder.cdef((THIS_DIR / "physac.h.modified").read_text()) |
| 214 | + ffibuilder.cdef((THIS_DIR / "raymath.h.modified").read_text()) |
210 | 215 |
|
211 | 216 | ffi_includes = """
|
212 | 217 | #include "raylib.h"
|
@@ -237,10 +242,10 @@ def build_windows():
|
237 | 242 | extra_compile_args=["/D_CFFI_NO_LIMITED_API"],
|
238 | 243 | py_limited_api=False,
|
239 | 244 | libraries=libraries,
|
240 |
| - include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src', |
241 |
| - 'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw\\include', |
242 |
| - 'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raygui\\src', |
243 |
| - 'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\physac\\src'], |
| 245 | + include_dirs=[str(REPO_ROOT / 'raylib-c/src'), |
| 246 | + str(REPO_ROOT / 'raylib-c/src/external/glfw/include'), |
| 247 | + str(REPO_ROOT / 'raygui/src'), |
| 248 | + str(REPO_ROOT / 'physac/src')], |
244 | 249 | )
|
245 | 250 |
|
246 | 251 |
|
|
0 commit comments