blob: 1d2ff99eeebf50214ff9c592365469fb5f07f8f4 [file] [log] [blame]
paragdixit-g1a501a12019-11-20 17:27:56 -08001# 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
Michael Spanga24737a2020-08-12 13:27:52 -040028import("etc/gn/openthread.gni")
paragdixit-g1a501a12019-11-20 17:27:56 -080029
Michael Spanga24737a2020-08-12 13:27:52 -040030config("openthread_config") {
Michael Spangd20a8952020-08-21 11:43:02 -040031 defines = []
Michael Spanga24737a2020-08-12 13:27:52 -040032 if (openthread_config_file != "") {
33 defines += [ "OPENTHREAD_CONFIG_FILE=${openthread_config_file}" ]
34 }
paragdixit-g1a501a12019-11-20 17:27:56 -080035
Michael Spanga24737a2020-08-12 13:27:52 -040036 include_dirs = openthread_project_include_dirs
paragdixit-g1a501a12019-11-20 17:27:56 -080037
Michael Spanga24737a2020-08-12 13:27:52 -040038 include_dirs += [
39 "${root_gen_dir}/include",
paragdixit-g1a501a12019-11-20 17:27:56 -080040 "include",
paragdixit-g1a501a12019-11-20 17:27:56 -080041 ]
Michael Spanga24737a2020-08-12 13:27:52 -040042}
43
44config("openthread_ftd_config") {
Michael Spangd20a8952020-08-21 11:43:02 -040045 defines = [
46 "OPENTHREAD_FTD=1",
47 "OPENTHREAD_MTD=0",
48 "OPENTHREAD_RADIO=0",
49 ]
Michael Spanga24737a2020-08-12 13:27:52 -040050}
51
52config("openthread_mtd_config") {
Michael Spangd20a8952020-08-21 11:43:02 -040053 defines = [
54 "OPENTHREAD_MTD=1",
55 "OPENTHREAD_FTD=0",
56 "OPENTHREAD_RADIO=0",
57 ]
Michael Spanga24737a2020-08-12 13:27:52 -040058}
59
60config("openthread_radio_config") {
Michael Spangd20a8952020-08-21 11:43:02 -040061 defines = [
62 "OPENTHREAD_RADIO=1",
63 "OPENTHREAD_FTD=0",
64 "OPENTHREAD_MTD=0",
65 ]
Michael Spanga24737a2020-08-12 13:27:52 -040066}
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") {
paragdixit-ga8198d02020-12-17 18:04:09 -0800105 public_deps = [
106 ":libopenthread-ftd",
107 "src/core:libopenthread-ftd",
108 "src/ncp:libopenthread-ncp-ftd",
109 ]
Michael Spanga24737a2020-08-12 13:27:52 -0400110 }
paragdixit-g1a501a12019-11-20 17:27:56 -0800111}