Each sample application and library is its own module in the Android NDK build system. This is a change from previous samples packs in which the libraries were, as a group, one single module. Now, the libraries are each their own static library module with a unique name. The applications import them using the NDK’s import module system.
For example, this means that to use the library nv_input
, an application must make the following additions to its Android.mk
:
LOCAL_STATIC_LIBRARIES
LOCAL_STATIC_LIBRARIES := nv_input
libs/jni
tree for the samples pack as an import library path $(call import-add-path, ../../../libs/jni)
$(call import-module,nv_input)
Note that import module libraries are built into each project that references them individually. There is no shared copy of the libraries. This can make an initial clean build of all applications take longer, but it ensures that each library is correctly built for the given application, and minimal rebuilds are quite fast.
Finally, note that because they are never built on their own, there are no Eclipse projects for the libraries. If the library source is to be edited, open the files and edit using the following:
Eclipse: File : Open…
NVIDIA® GameWorks™ Documentation Rev. 1.0.220830 ©2014-2022. NVIDIA Corporation and affiliates. All Rights Reserved.