1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/bin/sh
# Copyright 2019 Ryan Pavlik
# SPDX-License-Identifier: Apache-2.0
set -e
# set -x
MYDIR=$(mktemp -d)
trap "rm -rf $MYDIR" EXIT
SRC=$(pwd)
cd $MYDIR
FLAGS="-DOS_LINUX_XLIB -I${SRC}/external/include"
# must compile gfxwrapper separately first with cc
cc -std=c99 ${FLAGS} -c ${SRC}/src/common/gfxwrapper_opengl.c -o gfxwrapper.o
c++ \
-std=c++11 \
${FLAGS} \
-I${SRC}/src \
-I${SRC}/src/common \
-I${SRC}/src/tests/hello_xr/vulkan_shaders \
-DXR_USE_PLATFORM_XLIB \
-DXR_USE_GRAPHICS_API_OPENGL \
gfxwrapper.o \
${SRC}/src/tests/hello_xr/*.cpp \
$(pkg-config --cflags --libs openxr gl x11 xxf86vm xrandr) \
-o hello_xr
# ./hello_xr -g OpenGL
|