Skip to content

Commit 5851f53

Browse files
committed
openxr: Add new recipe
Add a recipe for the latest version of the OpenXR SDK.
1 parent 645a6b6 commit 5851f53

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

recipes/openxr.recipe

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
2+
import shutil
3+
4+
from cerbero.tools.libtool import LibtoolLibrary
5+
from cerbero.utils import android
6+
7+
class Recipe(recipe.Recipe):
8+
name = 'openxr'
9+
version = '1.1.52'
10+
stype = SourceType.TARBALL
11+
url = f'https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-{version}.tar.gz'
12+
tarball_checksum = '9ace2834c5f86a77df339865bc072e71d766f4348f3914257d8f87ebe64994a9'
13+
tarball_name = f'OpenXR-SDK-release-{version}.tar.gz'
14+
tarball_dirname = f'OpenXR-SDK-release-{version}'
15+
16+
licenses = [License.Apachev2]
17+
18+
btype = BuildType.CMAKE
19+
cmake_generator = 'ninja'
20+
library_type = LibraryType.SHARED
21+
22+
files_libs = ['libopenxr_loader']
23+
files_devel = ['include/openxr', 'lib/pkgconfig/openxr.pc']
24+
25+
configure_options = "\
26+
-DBUILD_TESTING=OFF \
27+
-DBUILD_TESTS=OFF \
28+
-DBUILD_CONFORMANCE_TESTS=OFF \
29+
-DCMAKE_INSTALL_LIBDIR=lib \
30+
"
31+
32+
def prepare(self):
33+
if self.config.target_platform == Platform.ANDROID:
34+
ndk_path = self.config.env['ANDROID_NDK_TOOLCHAIN_BIN'] + "/../../../../.."
35+
android_api = DistroVersion.get_android_api_version(self.config.target_distro_version)
36+
android_arch = android.get_android_arch_name(self.config.target_arch)
37+
self.configure_options += f' \
38+
-DCMAKE_TOOLCHAIN_FILE={ndk_path}/build/cmake/android.toolchain.cmake \
39+
-DANDROID_ABI={android_arch} \
40+
-DANDROID_PLATFORM=android-{android_api} \
41+
-DANDROID_STL=c++_shared \
42+
'
43+
self.append_env("CXXFLAGS", "-fexceptions")

0 commit comments

Comments
 (0)