1#  Copyright (c) 2019, The OpenThread Authors.
2#  All rights reserved.
3#
4#  Redistribution and use in source and binary forms, with or without
5#  modification, are permitted provided that the following conditions are met:
6#  1. Redistributions of source code must retain the above copyright
7#     notice, this list of conditions and the following disclaimer.
8#  2. Redistributions in binary form must reproduce the above copyright
9#     notice, this list of conditions and the following disclaimer in the
10#     documentation and/or other materials provided with the distribution.
11#  3. Neither the name of the copyright holder nor the
12#     names of its contributors may be used to endorse or promote products
13#     derived from this software without specific prior written permission.
14#
15#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25#  POSSIBILITY OF SUCH DAMAGE.
26#
27
28import("etc/gn/openthread.gni")
29
30config("openthread_config") {
31  defines = []
32  if (openthread_config_file != "") {
33    defines += [ "OPENTHREAD_CONFIG_FILE=${openthread_config_file}" ]
34  }
35
36  include_dirs = openthread_project_include_dirs
37
38  include_dirs += [
39    "${root_gen_dir}/include",
40    "include",
41  ]
42}
43
44config("openthread_ftd_config") {
45  defines = [
46    "OPENTHREAD_FTD=1",
47    "OPENTHREAD_MTD=0",
48    "OPENTHREAD_RADIO=0",
49  ]
50}
51
52config("openthread_mtd_config") {
53  defines = [
54    "OPENTHREAD_MTD=1",
55    "OPENTHREAD_FTD=0",
56    "OPENTHREAD_RADIO=0",
57  ]
58}
59
60config("openthread_radio_config") {
61  defines = [
62    "OPENTHREAD_RADIO=1",
63    "OPENTHREAD_FTD=0",
64    "OPENTHREAD_MTD=0",
65  ]
66}
67
68group("libopenthread-ftd") {
69  public_deps = [ "include/openthread" ]
70  deps = [ "src/core:libopenthread-ftd" ]
71}
72
73group("libopenthread-mtd") {
74  public_deps = [ "include/openthread" ]
75  deps = [ "src/core:libopenthread-mtd" ]
76}
77
78group("libopenthread-radio") {
79  public_deps = [ "include/openthread" ]
80  deps = [ "src/core:libopenthread-radio" ]
81}
82
83group("libopenthread-cli-ftd") {
84  public_deps = [ "include/openthread" ]
85  deps = [ "src/cli:libopenthread-cli-ftd" ]
86}
87
88group("libopenthread-cli-mtd") {
89  public_deps = [ "include/openthread" ]
90  deps = [ "src/cli:libopenthread-cli-mtd" ]
91}
92
93group("libopenthread-spinel-ncp") {
94  public_deps = [ "src/lib/spinel:spinel-api" ]
95  deps = [ "src/lib/spinel:libopenthread-spinel-ncp" ]
96}
97
98group("libopenthread-spinel-rcp") {
99  public_deps = [ "src/lib/spinel:spinel-api" ]
100  deps = [ "src/lib/spinel:libopenthread-spinel-rcp" ]
101}
102
103if (current_os == "fuchsia") {
104  group("lib-ot-core") {
105    public_deps = [
106      ":libopenthread-ftd",
107      "src/core:libopenthread-ftd",
108      "src/ncp:libopenthread-ncp-ftd",
109    ]
110  }
111}
112