cancel
Showing results for 
Search instead for 
Did you mean: 

Native C++ app - Include VRLib in repo?

rekodia-ahub
Honored Guest

I'm new to Oculus dev (and Android in general). I'm making a native app (which, correct me if I'm wrong, but on Oculus that means C++ as pure Java native (non-Unity) is not possible).

Reading through the example template in the SDK, it appears that in the jni/ directory Android.mk is required. However, it includes <sdk>/VRLib/import_vrlib.mk.

So, my question is, do I have to copy the whole SDK VRLib folder into my project? Do I check that into my repo?

I come from back-end continuously deployed systems where a CI server would look at a Maven pom.xml or a JavaScript Node.js package.json to fetch dependencies. So actually including lib source into a repo is weird to me.

As a follow up, what does jni/Application.mk in the example template do?

Thanks,

Alyssa Kwan, CTO, Rekodia

1 ACCEPTED SOLUTION

Accepted Solutions

chrispruett-ahu
Explorer

Hi Alyssa,

Best place to start is probably the documentation for the Android NDK package, which is included with the NDK tools distribution here:

https://developer.android.com/tools/sdk/ndk/index.html

It describes the function of Application.mk (mostly, to define all of the dependencies required to build a native C++ application) and other parts of the toolchain.

If you don't want to check the entire sdk directory into your repo, you could just copy the compiled vrlib.so files and associated headers into your project, fix the search paths for header inclusion, and then remove the dependency on VRLib/import_vrlib.mk. I'm not sure you win a lot back by doing this, though, as it complicates upgrading to future SDKs and doesn't save you much other than the removal of a build-time dependency (which, after the first compile, should become a nop anyway).

View solution in original post

2 REPLIES 2

chrispruett-ahu
Explorer

Hi Alyssa,

Best place to start is probably the documentation for the Android NDK package, which is included with the NDK tools distribution here:

https://developer.android.com/tools/sdk/ndk/index.html

It describes the function of Application.mk (mostly, to define all of the dependencies required to build a native C++ application) and other parts of the toolchain.

If you don't want to check the entire sdk directory into your repo, you could just copy the compiled vrlib.so files and associated headers into your project, fix the search paths for header inclusion, and then remove the dependency on VRLib/import_vrlib.mk. I'm not sure you win a lot back by doing this, though, as it complicates upgrading to future SDKs and doesn't save you much other than the removal of a build-time dependency (which, after the first compile, should become a nop anyway).

rekodia-ahub
Honored Guest

Thank you!

I think what I'll do is maintain a separate git repo for the SDK with a version tag that I can then git submodule in my app. That'll satisfy my neat freak neurosis about repos and ease upgrade for this and other apps I will have.

Given that submodules are cloned as whole units, I don't want to fetch the whole SDK, samples and all. So I'll need a branch that I maintain that has just the C++ bits. If that's just the ./jni/ folder, is that enough?