Compare commits
2
Commits
4aaf4009d0
...
c33b7e844d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33b7e844d | ||
|
|
73b6ff4132 |
+1
-1
@@ -1,2 +1,2 @@
|
||||
build/
|
||||
|
||||
.idea
|
||||
|
||||
@@ -4,25 +4,46 @@ Basic rainbow triangle rendered with Vulkan.
|
||||
|
||||
Created as a reference project while following the [official tutorial located here](https://docs.vulkan.org/tutorial/latest/00_Introduction.html)
|
||||
|
||||
## Compiling
|
||||
## Building
|
||||
|
||||
Scripts for Linux are located in ./scripts/.
|
||||
A windows and linux build_script binary compiled from [this](https://git.catgirls.fish/firewire/build-script) project has been included.
|
||||
You can just run that from the root of the repo with `./scripts/build_script build` (or `.\scripts\build_script.exe build` for windows) to build all release types.
|
||||
|
||||
Make sure you have a CPP compiler, CMake, and ninja installed.
|
||||
Most dependencies are included through the use of CPM, however you will need to install the VulkanSDK, which can be acquired from the [official site](https://vulkan.lunarg.com/sdk/home)
|
||||
|
||||
- `configure-{type].sh` - Creates and configures the associated build type in ./build/{type}.
|
||||
- `build-{type}.sh` - Builds the associated build type in ./build/{type}.
|
||||
- `build.sh` - Configures and builds all types in ./build/
|
||||
- `clean.sh` - Runs `ninja clean` on all build types
|
||||
On linux systems you'll likely need dependencies for GLFW.
|
||||
GLFW itself is included with this project, however its a lot simpler to just install glfw through your package manager and have it handle them.
|
||||
|
||||
If you are on linux and don't wish you build using the scripts you can go through
|
||||
the following steps:
|
||||
Ubuntu: `apt update && apt install libglfw3-dev`
|
||||
|
||||
1. `mkdir -p build; cd build`;
|
||||
2. `cmake ../`;
|
||||
3. `make -j 8`
|
||||
Fedora: `dnf install glfw-devel`
|
||||
|
||||
Windows users, you're on your own. (sorry)
|
||||
Arch: `pacman -S glfw`
|
||||
|
||||
## Running
|
||||
Compiled exe is `triangle` on linux or `triangle.exe` on windows.
|
||||
### Building manually
|
||||
|
||||
#### Linux
|
||||
|
||||
The normal cmake build process is all you need.
|
||||
|
||||
1. Make the build directory `mkdir -p build`
|
||||
2. Configure the project `cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release`
|
||||
3. Build! `cmake --build build`
|
||||
|
||||
#### Windows
|
||||
|
||||
1. Git clone the repo
|
||||
2. Run [cmake-gui](https://cmake.org/download/)
|
||||
3. Select the location you cloned the repo into as the source directory
|
||||
4. Create a new directory called 'build' in the source directory and select it
|
||||
as the build directory
|
||||
5. Configure and generate
|
||||
6. Open the generated Visual studio project
|
||||
7. Right click the project in the project explorer and select 'build'
|
||||
|
||||
## A note for MacOS users
|
||||
|
||||
I do not have a MacOS system to build or test on, so building is solely up to you.
|
||||
All code has been kept as cross-platform as possible so it _should_ just work,
|
||||
but if you run into any issues, feel free to submit a pull request with an updated
|
||||
codebase or readme with compilation instructions.
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p debug
|
||||
cd debug || exit
|
||||
ninja
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p release
|
||||
cd release || exit
|
||||
ninja
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p relwithdeb
|
||||
cd relwithdeb || exit
|
||||
ninja
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ../
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p debug
|
||||
cd debug || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||
ninja
|
||||
|
||||
cd ..
|
||||
mkdir -p release
|
||||
cd release || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
ninja
|
||||
|
||||
cd ..
|
||||
mkdir -p relwithdeb
|
||||
cd relwithdeb || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
ninja
|
||||
Executable
BIN
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
cd build/debug || exit
|
||||
ninja clean
|
||||
|
||||
cd ..
|
||||
cd release || exit
|
||||
ninja clean
|
||||
|
||||
cd ..
|
||||
cd relwithdeb || exit
|
||||
ninja clean
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p debug
|
||||
cd debug || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p release
|
||||
cd release || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ..
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
mkdir -p relwithdeb
|
||||
cd relwithdeb || exit
|
||||
cmake ../../ -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
Reference in New Issue
Block a user