paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 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 | |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 28 | import("etc/gn/openthread.gni") |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 29 | |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 30 | config("openthread_config") { |
Michael Spang | d20a895 | 2020-08-21 11:43:02 -0400 | [diff] [blame] | 31 | defines = [] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 32 | if (openthread_config_file != "") { |
| 33 | defines += [ "OPENTHREAD_CONFIG_FILE=${openthread_config_file}" ] |
| 34 | } |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 35 | |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 36 | include_dirs = openthread_project_include_dirs |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 37 | |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 38 | include_dirs += [ |
| 39 | "${root_gen_dir}/include", |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 40 | "include", |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 41 | ] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | config("openthread_ftd_config") { |
Michael Spang | d20a895 | 2020-08-21 11:43:02 -0400 | [diff] [blame] | 45 | defines = [ |
| 46 | "OPENTHREAD_FTD=1", |
| 47 | "OPENTHREAD_MTD=0", |
| 48 | "OPENTHREAD_RADIO=0", |
| 49 | ] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | config("openthread_mtd_config") { |
Michael Spang | d20a895 | 2020-08-21 11:43:02 -0400 | [diff] [blame] | 53 | defines = [ |
| 54 | "OPENTHREAD_MTD=1", |
| 55 | "OPENTHREAD_FTD=0", |
| 56 | "OPENTHREAD_RADIO=0", |
| 57 | ] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | config("openthread_radio_config") { |
Michael Spang | d20a895 | 2020-08-21 11:43:02 -0400 | [diff] [blame] | 61 | defines = [ |
| 62 | "OPENTHREAD_RADIO=1", |
| 63 | "OPENTHREAD_FTD=0", |
| 64 | "OPENTHREAD_MTD=0", |
| 65 | ] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | group("libopenthread-ftd") { |
| 69 | public_deps = [ "include/openthread" ] |
| 70 | deps = [ "src/core:libopenthread-ftd" ] |
| 71 | } |
| 72 | |
| 73 | group("libopenthread-mtd") { |
| 74 | public_deps = [ "include/openthread" ] |
| 75 | deps = [ "src/core:libopenthread-mtd" ] |
| 76 | } |
| 77 | |
| 78 | group("libopenthread-radio") { |
| 79 | public_deps = [ "include/openthread" ] |
| 80 | deps = [ "src/core:libopenthread-radio" ] |
| 81 | } |
| 82 | |
| 83 | group("libopenthread-cli-ftd") { |
| 84 | public_deps = [ "include/openthread" ] |
| 85 | deps = [ "src/cli:libopenthread-cli-ftd" ] |
| 86 | } |
| 87 | |
| 88 | group("libopenthread-cli-mtd") { |
| 89 | public_deps = [ "include/openthread" ] |
| 90 | deps = [ "src/cli:libopenthread-cli-mtd" ] |
| 91 | } |
| 92 | |
| 93 | group("libopenthread-spinel-ncp") { |
| 94 | public_deps = [ "src/lib/spinel:spinel-api" ] |
| 95 | deps = [ "src/lib/spinel:libopenthread-spinel-ncp" ] |
| 96 | } |
| 97 | |
| 98 | group("libopenthread-spinel-rcp") { |
| 99 | public_deps = [ "src/lib/spinel:spinel-api" ] |
| 100 | deps = [ "src/lib/spinel:libopenthread-spinel-rcp" ] |
| 101 | } |
| 102 | |
| 103 | if (current_os == "fuchsia") { |
| 104 | group("lib-ot-core") { |
paragdixit-g | a8198d0 | 2020-12-17 18:04:09 -0800 | [diff] [blame] | 105 | public_deps = [ |
| 106 | ":libopenthread-ftd", |
| 107 | "src/core:libopenthread-ftd", |
| 108 | "src/ncp:libopenthread-ncp-ftd", |
| 109 | ] |
Michael Spang | a24737a | 2020-08-12 13:27:52 -0400 | [diff] [blame] | 110 | } |
paragdixit-g | 1a501a1 | 2019-11-20 17:27:56 -0800 | [diff] [blame] | 111 | } |