mirror of https://github.com/bjornbytes/lovr.git
Update compilation instructions;
This commit is contained in:
parent
60cdfa3b1c
commit
216f8fe37e
60
COMPILING.md
60
COMPILING.md
|
@ -8,90 +8,68 @@ various operating systems.
|
||||||
Dependencies
|
Dependencies
|
||||||
---
|
---
|
||||||
|
|
||||||
- LuaJIT
|
- Lua or LuaJIT
|
||||||
- GLFW (3.2+)
|
- GLFW (3.2+)
|
||||||
- OpenGL (3.3, ES3, or WebGL 2)
|
- OpenGL (3.3, ES3, or WebGL 2)
|
||||||
- assimp
|
- assimp
|
||||||
- OpenVR (1.0.5, for `lovr.headset`)
|
- OpenVR (1.0.9, for `lovr.headset`)
|
||||||
- PhysicsFS
|
- PhysicsFS
|
||||||
- OpenAL (1.17+ recommended for HRTF support)
|
- OpenAL (1.17+ recommended for HRTF support)
|
||||||
- FreeType
|
- FreeType
|
||||||
|
- msdfgen
|
||||||
- ODE (for `lovr.physics`)
|
- ODE (for `lovr.physics`)
|
||||||
- Emscripten (optional, for compiling for web)
|
- Emscripten (optional, for compiling for web)
|
||||||
|
|
||||||
See [lovr-deps](https://github.com/bjornbytes/lovr-deps) for a GitHub repo containing all of these
|
The [lovr-deps](https://github.com/bjornbytes/lovr-deps) repository contains all dependencies as
|
||||||
as submodules.
|
git submodules. The build script expects this repository to exist under `lovr/deps`:
|
||||||
|
|
||||||
Windows (CMake)
|
|
||||||
---
|
|
||||||
|
|
||||||
First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps):
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd lovr
|
cd lovr
|
||||||
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
|
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, use CMake to generate the build files:
|
Windows (CMake)
|
||||||
|
---
|
||||||
|
|
||||||
|
From the `lovr` folder, run these commands to create a build folder and compile the project using
|
||||||
|
CMake:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
```
|
|
||||||
|
|
||||||
This should output a Visual Studio solution, which can be built using Visual Studio. Or you can
|
|
||||||
just build it with CMake:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cmake --build .
|
cmake --build .
|
||||||
```
|
```
|
||||||
|
|
||||||
The executable will then exist at `/path/to/lovr/build/Debug/lovr.exe`. The recommended way to
|
The executable will then exist at `/path/to/lovr/build/Debug/lovr.exe`. A LÖVR project (a folder
|
||||||
create and run a game from this point is:
|
containing a `main.lua` script) can then be dropped onto `lovr.exe` to run it, or it can be run
|
||||||
|
via the command line as `lovr.exe path/to/project`.
|
||||||
- Create a shortcut to the `lovr.exe` executable somewhere convenient.
|
|
||||||
- Create a folder for your game: `MySuperAwesomeGame`.
|
|
||||||
- Create a `main.lua` file in the folder and put your code in there.
|
|
||||||
- Drag the `MySuperAwesomeGame` folder onto the shortcut to `lovr.exe`.
|
|
||||||
|
|
||||||
Unix (CMake)
|
Unix (CMake)
|
||||||
---
|
---
|
||||||
|
|
||||||
First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone
|
Install the dependencies using your package manager of choice:
|
||||||
`openvr` into the same directory that `lovr` was cloned into.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone --branch v1.0.5 https://github.com/ValveSoftware/openvr.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, install the other dependencies above using your package manager of choice:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
brew install assimp glfw3 luajit physfs freetype openal-soft ode
|
brew install assimp glfw3 luajit physfs freetype openal-soft ode
|
||||||
```
|
```
|
||||||
|
|
||||||
On OSX, you'll need to set the `DYLD_LIBRARY_PATH` environment variable to be
|
Next, build using CMake, as above:
|
||||||
`/path/to/openvr/lib/osx32`.
|
|
||||||
|
|
||||||
Next, build using CMake:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DOPENVR_DIR=../../openvr
|
cmake ..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
```
|
```
|
||||||
|
|
||||||
The `lovr` executable should exist in `lovr/build` now. You can run a game like this:
|
The `lovr` executable should exist in `lovr/build` now. It's recommended to set up an alias or
|
||||||
|
symlink so that this executable exists on your path. Once that's done, you can run a game like this:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./lovr /path/to/myGame
|
lovr /path/to/myGame
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
|
|
||||||
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.
|
|
||||||
|
|
||||||
WebVR
|
WebVR
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue