OSDN Git Service

net_test_bluetooth: adapter test refactor
[android-x86/system-bt.git] / HACKING
1 Building with GN+ninja
2 ======================
3
4 system/bt is buildable using the GN and and ninja buildtools from the Chromium
5 project. After setting up these tools, several third_party packages need to be
6 set up to build the stack. It's a simple matter of copying (or sym-linking) some
7 packages out of AOSP into "system/bt/third_party":
8
9 From AOSP:
10 1. "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.
16 2. "platform/external/libchrome" => third_party/libchrome. After that, remove
17 the BUILD.gn file that's in libchrome/base. This is a legacy file that only
18 works inside the Chromium project and we're using our own from secondary build
19 sources.
20 3. "platform/external/modp_b64" => third_party/modp_b64
21 4. "platform/external/tinyxml2" => third_party/tinyxml2
22
23 From Chromium:
24 1. "src/testing/gtest" => third_party/gtest
25
26 You will also need a fresh checkout of platform/hardware/libhardware and
27 platform/system/core for some include dependencies.
28
29 BUILD.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
31 modp_b64 since it comes with its own; as the package was imported into AOSP from
32 Chromium). To build, run:
33
34 1. '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
39 Once done, this will create the *.ninja files for the entire project.
40
41 2. 'ninja -C out/Default all': This will build all targets (the shared library,
42 executables, tests, etc) and put them in out/Default (or whatever you named the
43 output directory. To build an individual target, replace "all" with the target
44 of your choice, e.g. 'ninja -C out/Default net_test_osi'.