Skip to content

Commit 240ede7

Browse files
update build docs (thanks @vinniec2)
1 parent 5f575bf commit 240ede7

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

BUILDING.rst

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Building from source
44
Have Pip build from source
55
--------------------------
66

7-
This is useful if the binaries don’t work on your system, or you want to use a newer version of Raylib.
7+
This is useful if the binaries don’t work on your system, or you want to use a newer version of Raylib, or compile
8+
Raylib with a different version of OpenGL than the default. (e.g. on old hardware use cmake option ``-DOPENGL_VERSION=1.1``)
89

910
First make sure Raylib is installed. On Linux/Mac it must include the pkg-config files. Best way to ensure this
1011
is to compile and install Raylib using CMake: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake
@@ -13,21 +14,47 @@ Requirements for build: cmake, pkg-config.
1314

1415
::
1516

16-
cd raylib-5.0
17-
mkdir build
18-
cd build
19-
cmake -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
20-
make
21-
sudo make install
22-
23-
17+
wget https://github.com/raysan5/raylib/archive/refs/tags/5.5.zip
18+
unzip 5.5.zip
19+
cd raylib-5.5
20+
mkdir build
21+
cd build
22+
cmake -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
23+
make
24+
sudo make install
25+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2426

2527
Then ask Pip to build from source:
2628

2729
::
2830

2931
pip3 install --no-cache-dir --no-binary raylib --upgrade --force-reinstall raylib
3032

33+
Environment variables (new in 5.5.0.3)
34+
--------------------------------------
35+
36+
If plg-config doesn't work you can manually set these environment variables:
37+
38+
``RAYLIB_PLATFORM``: Any one of: ``Desktop``, ``SDL``, ``DRM``, ``PLATFORM_COMMA``
39+
40+
``RAYLIB_LINK_ARGS``: Arguments to pass to the linker rather than getting them from pkg-config.
41+
e.g.: ``"-L/usr/local/lib -lraylib"``
42+
43+
``RAYLIB_INCLUDE_PATH``: Directory to find raylib.h rather than getting from pkg-config.
44+
e.g.: ``/usr/local/include``
45+
46+
``RAYGUI_INCLUDE_PATH``: Directory to find raygui.h
47+
e.g.: ``/usr/local/include``
48+
49+
``GLFW_INCLUDE_PATH``: Directory to find glfw3.h
50+
e.g.: ``/usr/local/include/GLFW``
51+
52+
``PHYSAC_INCLUDE_PATH``: Directory to find physac.h
53+
e.g.: ``/usr/local/include``
54+
55+
``LIBFFI_INCLUDE_PATH``:
56+
e.g.: ``/usr/local/include``
57+
3158
Or, Build from source manually
3259
------------------------------
3360

@@ -116,6 +143,7 @@ Build and install Raylib from the raylib-c directory.
116143
cd build
117144
cmake -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
118145
sudo make install
146+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
119147

120148
.. note:: Optional: Build the Raylib shared libs, if you plan to use
121149
``raylib_dynamic`` binding.

0 commit comments

Comments
 (0)