Skip to content

Linux Build #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@ jobs:
uses: ConorMacBride/install-package@v1
with:
apt: libxmu-dev libxi-dev libgl-dev libxcb-glx0-dev libglu1-mesa-dev libxxf86vm-dev libxrandr-dev
- name: Install CMake
uses: lukka/[email protected]
- name: Create Build Dir
run: mkdir build
- name: CMake Configure
working-directory: build
run: cmake -DSHIPPING=ON -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" ..
- name: CMake Build
working-directory: build
run: cmake --build . --config=Release
- name: Project Build
run: |
chmod +x build.sh
./build.sh linux
build-windows:
runs-on: windows-latest
steps:
Expand All @@ -46,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: windows-build
path: build/Release
path: build/Release
21 changes: 4 additions & 17 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,10 @@ And the resulting exe will use that copy. You can then zip up the folder and di

Linux Build (vcpkg submodule)
--------------------
* Install dependencies
- `sudo apt-get install clang`
- `sudo apt-get install cmake`
- `sudo apt-get install freeglut3-dev`
- `sudo apt-get install libopenxr-dev`
* Ensure splatapult has the vcpkg submodule.
Either clone with the --recursive flag so that the vcpkg submodule is added
or execute `git submodule init` and `git submodule update` after a regular clone.
* Bootstrap vcpkg
- `cd vcpkg`
- `bootstrap-vcpg.sh`
* Execute cmake to create a Makefile
- `mkdir build`
- `cd build`
- `cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake`
* build executable
- `cmake --build . --config=Release`
* The project and its dependencies can be installed using the following command:
```bash
./build.sh linux
```

*EXPERIMENTAL* Meta Quest Build (OUT OF DATE)
--------------------
Expand Down
56 changes: 56 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# Function to display usage instructions
usage() {
echo "Usage: $0 [platform] [shipping]"
echo "platform: linux"
echo "shipping: optional, use 'shipping' to create a shipping build"
exit 1
}

# Check for platform argument
if [ -z "$1" ]; then
usage
fi

PLATFORM="$1"
SHIPPING=""
if [ "$2" == "shipping" ]; then
SHIPPING="-DSHIPPING=ON"
fi

# General steps
init_vcpkg() {
echo "Initializing vcpkg submodule..."
git submodule init && git submodule update
}

build_linux() {
echo "Building for Linux..."
echo "Installing dependencies..."
sudo apt-get install -y clang cmake freeglut3-dev libopenxr-dev meson python3-jinja2
init_vcpkg
cd vcpkg || exit
./bootstrap-vcpkg.sh
cd .. || exit
mkdir -p build && cd build || exit
cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake $SHIPPING
cmake --build . --config=Release
}

case "$PLATFORM" in
windows)
build_windows
;;
linux)
build_linux
;;
quest)
build_quest
;;
*)
usage
;;
esac

echo "Build script complete."