Skip to content

Commit

Permalink
Enable building of the chapters.
Browse files Browse the repository at this point in the history
* Enables Linux (Vulkan, OpenGL)
* Enables Android (Vulkan, OpenGLES)
  • Loading branch information
rbessems committed Feb 28, 2024
1 parent ed594b6 commit 45c4f73
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Android Build Chapters'
on:
pull_request:
branches: [ "main" ]
# tags:
# - "v*.*.*"
# workflow_dispatch:

jobs:
build:
name: Android Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
target: [android]
graphics: [VULKAN, OPENGL_ES]
chapter: [Chapter1, Chapter2, Chapter3, Chapter4, Chapter5]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.chapter }} using ${{ matrix.gfx }} on ${{ matrix.os }}
run: |
echo "Building ${{ matrix.chapter }} using ${{ matrix.gfx }} on ${{ matrix.os }} ${{ github.ref_name }}"
export GFX=${{ matrix.graphics }}
cd ${{ matrix.chapter }}
chmod 755 gradlew
./gradlew assembleDebug
39 changes: 39 additions & 0 deletions .github/workflows/build-host-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Linux Build Chapters'
on:
pull_request:
branches: [ "main" ]
# tags:
# - "v*.*.*"
# workflow_dispatch:

jobs:
build:
name: Linux Build
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
target: [linux]
graphics: [VULKAN, OPENGL]
steps:
- name: Setup
run: |
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1-mesa-dev
sudo apt install vulkan-tools
sudo apt install libvulkan-dev
sudo apt install vulkan-validationlayers-dev spirv-tools glslang-tools
sudo apt install libxrandr-dev libxxf86vm-dev
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
sudo apt-get install libgl1-mesa-dev libvulkan-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev mesa-common-dev
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.gfx }} on ${{ matrix.os }}
run: |
echo "Building ${{ matrix.os }} ${{ github.ref_name }}"
export GFX=${{ matrix.graphics }}
mkdir build
cd build
cmake ..
cmake --build .
30 changes: 30 additions & 0 deletions .github/workflows/build-host-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Windows Build Chapters'
on:
pull_request:
branches: [ "main" ]
# tags:
# - "v*.*.*"
# workflow_dispatch:

jobs:
build:
if: false
name: Windows Build
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
matrix:
os: [windows-latest]
target: [windows]
graphics: [VULKAN, OPENGL, DX11, DX12]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.gfx }} on ${{ matrix.os }}
run: |
echo "Building ${{ matrix.os }} ${{ github.ref_name }}"
set GFX=${{ matrix.graphics }}
mkdir build
cd build
cmake ..
cmake --build .
11 changes: 5 additions & 6 deletions cmake/graphics_api_select.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

include_guard()


set(XR_TUTORIAL_GRAPHICS_API "VULKAN" CACHE STRING "Which graphics API to use when building the tutorial projects.")
if(WIN32)
set_property(CACHE XR_TUTORIAL_GRAPHICS_API PROPERTY STRINGS D3D11 D3D12 OPENGL VULKAN)
elseif(LINUX AND NOT ANDROID)
set_property(CACHE XR_TUTORIAL_GRAPHICS_API PROPERTY STRINGS OPENGL VULKAN)
elseif(ANDROID)
set_property(CACHE XR_TUTORIAL_GRAPHICS_API PROPERTY STRINGS OPENGL_ES VULKAN)

IF(DEFINED ENV{GFX})
message(STATUS, "Overriding graphics api: " $ENV{GFX} )
set_property(CACHE XR_TUTORIAL_GRAPHICS_API PROPERTY VALUE $ENV{GFX})
endif()

function(AddGraphicsAPIDefine PROJECT_NAME)
Expand Down

0 comments on commit 45c4f73

Please sign in to comment.