|
32 | 32 | # |
33 | 33 | # Environment variables you can set before build |
34 | 34 | # |
35 | | -# RAYLIB_PLATFORM: Any one of: Desktop, SDL, DRM, PLATFORM_COMMA |
| 35 | +# RAYLIB_PLATFORM: Any one of: Desktop, SDL, DRM, PLATFORM_COMMA, SDL_SOFTWARE |
36 | 36 | # RAYLIB_LINK_ARGS: Arguments to pass to the linker rather than getting them from pkg-config. |
37 | 37 | # e.g.: -L/usr/local/lib -lraylib |
38 | 38 | # RAYLIB_INCLUDE_PATH: Directory to find raylib.h rather than getting from pkg-config. |
@@ -143,7 +143,7 @@ def build_unix(): |
143 | 143 | raise Exception("ERROR: raylib not found by pkg-config. Please install pkg-config and Raylib" |
144 | 144 | "or else set RAYLIB_LINK_ARGS env variable.") |
145 | 145 |
|
146 | | - if RAYLIB_PLATFORM=="SDL" and os.getenv("RAYLIB_LINK_ARGS") is None and not check_sdl_pkgconfig_installed(): |
| 146 | + if RAYLIB_PLATFORM.startswith("SDL") and os.getenv("RAYLIB_LINK_ARGS") is None and not check_sdl_pkgconfig_installed(): |
147 | 147 | print("PKG_CONFIG_PATH is set to: "+os.getenv("PKG_CONFIG_PATH")) |
148 | 148 | raise Exception("ERROR: SDL3 not found by pkg-config. Please install pkg-config and SDL3." |
149 | 149 | "or else set RAYLIB_LINK_ARGS env variable.") |
@@ -235,17 +235,20 @@ def build_unix(): |
235 | 235 | flags = os.getenv("RAYLIB_LINK_ARGS") |
236 | 236 | if flags is None: |
237 | 237 | flags = get_lib_flags_from_pkgconfig() |
238 | | - extra_link_args = flags.split() + [ '-lm', '-lpthread', '-lGL', |
| 238 | + extra_link_args = flags.split() + [ '-lm', '-lpthread', |
239 | 239 | '-lrt', '-lm', '-ldl', '-lpthread', '-latomic'] |
240 | 240 | if RAYLIB_PLATFORM=="SDL": |
241 | | - extra_link_args += ['-lX11','-lSDL3'] |
| 241 | + extra_link_args += ['-lX11','-lGL', '-lSDL3'] |
242 | 242 | elif RAYLIB_PLATFORM=="DRM": |
243 | | - extra_link_args += ['-lEGL', '-lgbm'] |
| 243 | + extra_link_args += ['-lGL', '-lEGL', '-lgbm'] |
244 | 244 | elif RAYLIB_PLATFORM=="PLATFORM_COMMA": |
245 | | - extra_link_args.remove('-lGL') |
246 | 245 | extra_link_args += ['-lGLESv2', '-lEGL', '-lwayland-client', '-lwayland-egl'] |
| 246 | + elif RAYLIB_PLATFORM=="Desktop": |
| 247 | + extra_link_args += ['-lX11','-lGL'] |
| 248 | + elif RAYLIB_PLATFORM=="SDL_SOFT": |
| 249 | + extra_link_args += ['-lX11', '-lSDL3'] |
247 | 250 | else: |
248 | | - extra_link_args += ['-lX11'] |
| 251 | + raise Exception("Unknown or not set RAYLIB_PLATFORM") |
249 | 252 | extra_compile_args = ["-Wno-incompatible-pointer-types", "-D_CFFI_NO_LIMITED_API"] |
250 | 253 | libraries = [] # Not sure why but we put them in extra_link_args instead so *shouldnt* be needed here |
251 | 254 |
|
|
0 commit comments