Skip to content

Commit ef8141c

Browse files
bindings for on device (#1)
1 parent 4bdd922 commit ef8141c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

raylib/build.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,24 @@
2525
import subprocess
2626
import time
2727

28-
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
28+
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "")
29+
RAYLIB_INCLUDE_PATH = os.getenv("RAYLIB_INCLUDE_PATH", "")
30+
RAYLIB_LIB_PATH = os.getenv("RAYLIB_LIB_PATH", "")
2931

3032
def check_raylib_installed():
31-
return subprocess.run(['pkg-config', '--exists', 'raylib'], text=True, stdout=subprocess.PIPE).returncode == 0
33+
return os.path.isfile(os.path.join(RAYLIB_LIB_PATH, 'libraylib.a'))
3234

3335
def check_SDL_installed():
3436
return subprocess.run(['pkg-config', '--exists', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
3537

3638
def get_the_include_path():
37-
return subprocess.run(['pkg-config', '--variable=includedir', 'raylib'], text=True,
38-
stdout=subprocess.PIPE).stdout.strip()
39-
39+
return RAYLIB_INCLUDE_PATH
4040

4141
def get_the_lib_path():
42-
return subprocess.run(['pkg-config', '--variable=libdir', 'raylib'], text=True,
43-
stdout=subprocess.PIPE).stdout.strip()
42+
return RAYLIB_LIB_PATH
4443

4544
def get_lib_flags():
46-
return subprocess.run(['pkg-config', '--libs', 'raylib'], text=True,
47-
stdout=subprocess.PIPE).stdout.strip().split()
45+
return [f'-L{RAYLIB_LIB_PATH}', '-lraylib']
4846

4947
def pre_process_header(filename, remove_function_bodies=False):
5048
print("Pre-processing " + filename)
@@ -180,6 +178,9 @@ def build_unix():
180178
extra_link_args += ['-lX11','-lSDL2']
181179
elif RAYLIB_PLATFORM=="DRM":
182180
extra_link_args += ['-lEGL', '-lgbm']
181+
elif RAYLIB_PLATFORM=="PLATFORM_COMMA":
182+
extra_link_args.remove('-lGL')
183+
extra_link_args += ['-lGLESv2', '-lEGL', '-lwayland-client', '-lwayland-egl']
183184
else:
184185
extra_link_args += ['-lX11']
185186
extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"]

0 commit comments

Comments
 (0)