Skip to content

* fix hard-coded path in Windows build. #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions BUILDING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ To build a binary wheel distribution:
pip3 install wheel
python setup.py bdist_wheel

.. TODO::
There's a hardcoded path (to the raylib header files) in `raylib/build.py` you will probably need to edit.
Would be useful if some Windows user could figure out how to auto detect this.


Then install it:

::
Expand Down
25 changes: 15 additions & 10 deletions raylib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
import sys
import subprocess
import time
from pathlib import Path

THIS_DIR = Path(__file__).resolve().parent
REPO_ROOT = THIS_DIR.parent


RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")

Expand Down Expand Up @@ -200,13 +205,13 @@ def build_unix():

def build_windows():
print("BUILDING FOR WINDOWS")
ffibuilder.cdef(open("raylib/raylib.h.modified").read())
ffibuilder.cdef((THIS_DIR / "raylib.h.modified").read_text())
if RAYLIB_PLATFORM=="Desktop":
ffibuilder.cdef(open("raylib/glfw3.h.modified").read())
ffibuilder.cdef(open("raylib/rlgl.h.modified").read())
ffibuilder.cdef(open("raylib/raygui.h.modified").read())
ffibuilder.cdef(open("raylib/physac.h.modified").read())
ffibuilder.cdef(open("raylib/raymath.h.modified").read())
ffibuilder.cdef((THIS_DIR / "glfw3.h.modified").read_text())
ffibuilder.cdef((THIS_DIR / "rlgl.h.modified").read_text())
ffibuilder.cdef((THIS_DIR / "raygui.h.modified").read_text())
ffibuilder.cdef((THIS_DIR / "physac.h.modified").read_text())
ffibuilder.cdef((THIS_DIR / "raymath.h.modified").read_text())

ffi_includes = """
#include "raylib.h"
Expand Down Expand Up @@ -237,10 +242,10 @@ def build_windows():
extra_compile_args=["/D_CFFI_NO_LIMITED_API"],
py_limited_api=False,
libraries=libraries,
include_dirs=['D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raylib-c\\src\\external\\glfw\\include',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\raygui\\src',
'D:\\a\\raylib-python-cffi\\raylib-python-cffi\\physac\\src'],
include_dirs=[str(REPO_ROOT / 'raylib-c/src'),
str(REPO_ROOT / 'raylib-c/src/external/glfw/include'),
str(REPO_ROOT / 'raygui/src'),
str(REPO_ROOT / 'physac/src')],
)


Expand Down