Building in Android

Create a cc_library_static to build the C++ library, including the CXX generated header and source file.

  1. cc_library_static {
  2. name: "libcxx_test_cpp",
  3. srcs: ["cxx_test.cpp"],
  4. generated_headers: [
  5. "cxx-bridge-header",
  6. "libcxx_test_bridge_header"
  7. ],
  8. generated_sources: ["libcxx_test_bridge_code"],
  9. }
  • Point out that libcxx_test_bridge_header and libcxx_test_bridge_code are the dependencies for the CXX-generated C++ bindings. We’ll show how these are setup on the next slide.
  • Note that you also need to depend on the cxx-bridge-header library in order to pull in common CXX definitions.
  • Full docs for using CXX in Android can be found in the Android docs. You may want to share that link with the class so that students know where they can find these instructions again in the future.