Merged platform build instructions in Readme

This commit is contained in:
Jonathan Moallem 2020-11-20 23:16:49 +11:00 committed by GitHub
parent ded984c277
commit 6b54246dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,44 +15,48 @@ So that being said, we hope that this repository finds you well and wholehearted
### Current Compatability ### Current Compatability
| OS | Default Compiler | Last Tested On | Working | | OS | Default Compiler | Last Tested On | Working |
| ----------- | ---------------- |:------------------:|:-------:| | ----------- | ---------------- | ------------------ |:-------:|
| **macOS** | Clang++ | `Big Sur 11.0.1` | ✅ | | **macOS** | Clang++ | `Big Sur 11.0.1` | ✅ |
| **Linux** | G++ | `Ubuntu 20.04 LTS` | ❌ | | **Linux** | G++ | `Ubuntu 20.04 LTS` | ❌ |
| **Windows** | MinGW | `Windows 10 19041` | ✅ | | **Windows** | MinGW | `Windows 10 19041` | ✅ |
## Getting Started ## Getting Started
### MacOS ### Installing Dependencies
1. Download the [raylib](https://github.com/raysan5/raylib) repository and generate a static library file (`.a` on UNIX-based systems) using the [build and installation instructions](https://github.com/raysan5/raylib#build-and-installation) in the repository README.
2. Clone this repository and move the static library file you just generated into the `/lib` directory (go ahead and replace the one included if necessary), and then run the following command for the Makefile in the root directory: #### Installing MinGW (Windows only)
```bash
$ make all
```
3. Enjoy! You can now start programming your game from `src/main.cpp`.
### Windows
Building [raylib](https://github.com/raysan5/raylib) libraries requires the installation of MinGW ([32](http://www.mingw.org/) and [64](http://mingw-w64.org/doku.php/download) bit versions). Please ensure that all you link MinGW's `bin` directory to your system environment variables for BOTH the 32 and 64 bit versions. You can follow the instructions here for the [32-bit](https://www.youtube.com/watch?v=sXW2VLrQ3Bs) and here for the [64-bit](https://code.visualstudio.com/docs/cpp/config-mingw) bit versions. Building [raylib](https://github.com/raysan5/raylib) libraries requires the installation of MinGW ([32](http://www.mingw.org/) and [64](http://mingw-w64.org/doku.php/download) bit versions). Please ensure that all you link MinGW's `bin` directory to your system environment variables for BOTH the 32 and 64 bit versions. You can follow the instructions here for the [32-bit](https://www.youtube.com/watch?v=sXW2VLrQ3Bs) and here for the [64-bit](https://code.visualstudio.com/docs/cpp/config-mingw) bit versions.
After installing MinGW, you should be able to execute basic g++ commands. You can verify this by running the command: After installing MinGW, you should be able to execute basic g++ commands. You can verify this by running the command:
```console
```
$ g++ --version $ g++ --version
$ g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
```
### Building the Project
1. Download the [raylib](https://github.com/raysan5/raylib) repository and generate a static library file (`.a` on UNIX-based systems or `.lib` on Windows) using the [build and installation instructions](https://github.com/raysan5/raylib#build-and-installation) in the repository README.
2. Clone this repository and move the static library file you just generated into the `/lib/<platform>` directory (go ahead and replace the one included if necessary), and then run the following command for the Makefile in the project's root directory:
#### macOS & Linux
```console
$ make
``` ```
With this in place, you should then be able to clone this repository and open up the command prompt from the project root. From there, run the following: #### Windows
```console
$ mingw32-make
```
`$ mingw32-make` If you see a window pop up with a white background and text then you've successfully set the project up.
This should compile and run the project. If you see a window pop up with a white background and text then you've successfully set the project up. Good luck and have fun! 3. Enjoy! You can now start programming your game from `src/main.cpp`.
### Additional Notes ### Additional Notes
If you wish to change the program entry point, add more libraries, or really anything about your project, all build instructions are specified in the `Makefile` - no smoke and mirrors! If you wish to change the program entry point, add more libraries, or really anything about your project, all build instructions are specified in the `Makefile` - no smoke and mirrors!
### Todo ## Todo
- ~~Get static linking to work with C++ bindings~~ - ~~Get static linking to work with C++ bindings~~
- Setup for at least one compiler on each platform - Setup for at least one compiler on each platform
- Test with multiple compilers on each platform - Test with multiple compilers on each platform