blob: bf545034208cb163201ad3c2fe163f36527db443 [file] [log] [blame]
Arman Uguray0ca99052015-07-07 17:00:09 -07001Building with GN+ninja
2======================
3
4system/bt is buildable using the GN and and ninja buildtools from the Chromium
5project. After setting up these tools, several third_party packages need to be
6set up to build the stack. It's a simple matter of copying (or sym-linking) some
7packages out of AOSP into "system/bt/third_party":
8
9From AOSP:
101. "platform/external/libevent" => third_party/libevent. The relevant
11 headers here are "event.h" and "event-config.h". event-config.h from
12 external/libevent is only compatible on Android; this means that you will need
13 to generate a new one based on the current platform. Please follow the
14 instructions in external/libevent/README.android for instructions on how to
15 generate this file.
162. "platform/external/libchrome" => third_party/libchrome. After that, remove
17the BUILD.gn file that's in libchrome/base. This is a legacy file that only
18works inside the Chromium project and we're using our own from secondary build
19sources.
203. "platform/external/modp_b64" => third_party/modp_b64
214. "platform/external/tinyxml2" => third_party/tinyxml2
22
23From Chromium:
241. "src/testing/gtest" => third_party/gtest
25
26You will also need a fresh checkout of platform/hardware/libhardware and
27platform/system/core for some include dependencies.
28
29BUILD.gn files for all of these packages have already been set up under
30"system/bt/build/secondary/third_party" (note: we don't have a BUILD.gn file for
31modp_b64 since it comes with its own; as the package was imported into AOSP from
32Chromium). To build, run:
33
341. 'gn args out/Default': This will prompt you to fill the contents of your
35"args.gn" file. Set the two following variables:
36 a. libhw_include_path=<path to your "platform/hardware/libhardware/include">
37 b. core_include_path=<path to your "platform/system/core/include">
38
39Once done, this will create the *.ninja files for the entire project.
40
412. 'ninja -C out/Default all': This will build all targets (the shared library,
42executables, tests, etc) and put them in out/Default (or whatever you named the
43output directory. To build an individual target, replace "all" with the target
44of your choice, e.g. 'ninja -C out/Default net_test_osi'.