Libraries and App Builds


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:

  1. Add the library name to LOCAL_STATIC_LIBRARIES
    LOCAL_STATIC_LIBRARIES := nv_input
  2. Add the path to the libs/jni tree for the samples pack as an import library path
    $(call import-add-path, ../../../libs/jni)
  3. Import the library module itself
    $(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.200608 ©2014-2020. NVIDIA Corporation. All Rights Reserved.