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 "src/include", 42 ] 43} 44 45config("openthread_ftd_config") { 46 defines = [ 47 "OPENTHREAD_FTD=1", 48 "OPENTHREAD_MTD=0", 49 "OPENTHREAD_RADIO=0", 50 ] 51} 52 53config("openthread_mtd_config") { 54 defines = [ 55 "OPENTHREAD_MTD=1", 56 "OPENTHREAD_FTD=0", 57 "OPENTHREAD_RADIO=0", 58 ] 59} 60 61config("openthread_radio_config") { 62 defines = [ 63 "OPENTHREAD_RADIO=1", 64 "OPENTHREAD_FTD=0", 65 "OPENTHREAD_MTD=0", 66 ] 67} 68 69group("libopenthread-ftd") { 70 public_deps = [ "include/openthread" ] 71 deps = [ "src/core:libopenthread-ftd" ] 72} 73 74group("libopenthread-mtd") { 75 public_deps = [ "include/openthread" ] 76 deps = [ "src/core:libopenthread-mtd" ] 77} 78 79group("libopenthread-radio") { 80 public_deps = [ "include/openthread" ] 81 deps = [ "src/core:libopenthread-radio" ] 82} 83 84group("libopenthread-cli-ftd") { 85 public_deps = [ "include/openthread" ] 86 deps = [ "src/cli:libopenthread-cli-ftd" ] 87} 88 89group("libopenthread-cli-mtd") { 90 public_deps = [ "include/openthread" ] 91 deps = [ "src/cli:libopenthread-cli-mtd" ] 92} 93 94group("libopenthread-spinel-ncp") { 95 public_deps = [ "src/lib/spinel:spinel-api" ] 96 deps = [ "src/lib/spinel:libopenthread-spinel-ncp" ] 97} 98 99group("libopenthread-spinel-rcp") { 100 public_deps = [ "src/lib/spinel:spinel-api" ] 101 deps = [ "src/lib/spinel:libopenthread-spinel-rcp" ] 102} 103 104if (current_os == "fuchsia") { 105 group("lib-ot-core") { 106 public_deps = [ 107 ":libopenthread-ftd", 108 "src/core:libopenthread-ftd", 109 "src/ncp:libopenthread-ncp-ftd", 110 ] 111 } 112} 113