Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 1 | # Copyright (c) 2020 Project CHIP Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 15 | import("//build_overrides/build.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 16 | import("//build_overrides/chip.gni") |
| 17 | import("//build_overrides/mbedtls.gni") |
| 18 | import("//build_overrides/nlassert.gni") |
| 19 | import("//build_overrides/nlio.gni") |
| 20 | import("//build_overrides/nlunit_test.gni") |
| 21 | import("//build_overrides/pigweed.gni") |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 22 | |
Michael Spang | bad533e | 2021-03-09 01:28:51 -0500 | [diff] [blame] | 23 | import("//src/lwip/lwip.gni") |
Kamil Kasperczyk | d05149c | 2021-01-05 16:05:27 +0100 | [diff] [blame] | 24 | import("//src/platform/device.gni") |
szatmz | 2244db6 | 2020-12-04 14:42:01 -0500 | [diff] [blame] | 25 | import("$dir_pw_build/python.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 26 | |
| 27 | # This build file should not be used in superproject builds. |
| 28 | assert(chip_root == "//") |
| 29 | |
Michael Spang | 09611bf | 2021-03-02 16:31:57 -0500 | [diff] [blame] | 30 | import("${chip_root}/build/chip/tests.gni") |
| 31 | import("${chip_root}/build/chip/tools.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 32 | |
Evgeny Margolis | f0e9f91 | 2021-05-13 16:02:38 -0700 | [diff] [blame] | 33 | import("//src/crypto/crypto.gni") |
| 34 | |
Rob Mohr | 41c76b6 | 2021-06-02 12:43:21 -0700 | [diff] [blame] | 35 | if (current_toolchain != "${dir_pw_toolchain}/default:default") { |
Andrei Litvin | 2d86349 | 2020-10-02 17:28:58 -0400 | [diff] [blame] | 36 | declare_args() { |
Michael Spang | 4833d9c | 2020-10-09 09:33:02 -0400 | [diff] [blame] | 37 | chip_enable_python_modules = |
Song Guo | d652be4 | 2020-11-11 00:34:35 +0800 | [diff] [blame] | 38 | (current_os == "mac" || current_os == "linux") && |
| 39 | (host_cpu == "x64" || host_cpu == "arm64") |
Josh V [Apple] | 1ec6161 | 2021-08-18 12:52:27 -0700 | [diff] [blame] | 40 | enable_pylib = false |
Andrei Litvin | 2d86349 | 2020-10-02 17:28:58 -0400 | [diff] [blame] | 41 | } |
| 42 | |
szatmz | 2244db6 | 2020-12-04 14:42:01 -0500 | [diff] [blame] | 43 | # Python packages for supporting specific targets. |
| 44 | pw_python_group("python_packages") { |
| 45 | python_deps = [ |
Michael Spang | 4e8080b | 2021-02-12 15:03:57 -0500 | [diff] [blame] | 46 | "$dir_pw_build/py", |
| 47 | "$dir_pw_doctor/py", |
| 48 | "$dir_pw_env_setup/py", |
| 49 | "$dir_pw_hdlc/py", |
Yuanyao Zhong | 4e7c5e9 | 2022-01-13 14:58:00 -0500 | [diff] [blame] | 50 | "$dir_pw_log:protos.python", |
Michael Spang | 4e8080b | 2021-02-12 15:03:57 -0500 | [diff] [blame] | 51 | "$dir_pw_module/py", |
| 52 | "$dir_pw_protobuf/py", |
| 53 | "$dir_pw_protobuf_compiler/py", |
| 54 | "$dir_pw_rpc/py", |
| 55 | "$dir_pw_status/py", |
| 56 | "$dir_pw_toolchain/py", |
Yuanyao Zhong | 4e7c5e9 | 2022-01-13 14:58:00 -0500 | [diff] [blame] | 57 | "$dir_pw_trace/py", |
| 58 | "$dir_pw_trace_tokenized/py", |
Michael Spang | 4e8080b | 2021-02-12 15:03:57 -0500 | [diff] [blame] | 59 | "$dir_pw_unit_test/py", |
| 60 | "$dir_pw_watch/py", |
szatmz | 2244db6 | 2020-12-04 14:42:01 -0500 | [diff] [blame] | 61 | "integrations/mobly:chip_mobly", |
Rob Mohr | 5cda0bd | 2021-04-10 01:23:15 -0700 | [diff] [blame] | 62 | "scripts:requirements", |
szatmz | 2244db6 | 2020-12-04 14:42:01 -0500 | [diff] [blame] | 63 | ] |
| 64 | } |
| 65 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 66 | # This is a real toolchain. Build CHIP. |
| 67 | group("default") { |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 68 | deps = [ |
| 69 | "${chip_root}/src/app", |
| 70 | "${chip_root}/src/ble", |
| 71 | "${chip_root}/src/controller", |
Evgeny Margolis | 5353858 | 2021-01-12 09:14:24 -0800 | [diff] [blame] | 72 | "${chip_root}/src/credentials", |
Tennessee Carmel-Veilleux | 22fb6c3 | 2022-02-22 16:49:16 -0500 | [diff] [blame] | 73 | "${chip_root}/src/credentials:default_attestation_verifier", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 74 | "${chip_root}/src/crypto", |
| 75 | "${chip_root}/src/inet", |
| 76 | "${chip_root}/src/lib", |
Evgeny Margolis | df86212 | 2020-10-22 07:47:27 -0700 | [diff] [blame] | 77 | "${chip_root}/src/lib/asn1", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 78 | "${chip_root}/src/lib/core", |
| 79 | "${chip_root}/src/lib/support", |
Yufeng Wang | 4fc19f1 | 2020-10-22 16:14:32 -0700 | [diff] [blame] | 80 | "${chip_root}/src/messaging", |
Yufeng Wang | a3d4054 | 2020-11-04 13:12:48 -0800 | [diff] [blame] | 81 | "${chip_root}/src/protocols", |
Rob Walker | b14e3e3 | 2020-08-20 13:59:22 -0700 | [diff] [blame] | 82 | "${chip_root}/src/setup_payload", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 83 | "${chip_root}/src/system", |
| 84 | "${chip_root}/src/transport", |
| 85 | "${mbedtls_root}:mbedtls", |
| 86 | "${nlassert_root}:nlassert", |
| 87 | "${nlio_root}:nlio", |
| 88 | "${nlunit_test_root}:nlunit-test", |
| 89 | ] |
| 90 | |
Kamil Kasperczyk | d05149c | 2021-01-05 16:05:27 +0100 | [diff] [blame] | 91 | if (chip_device_platform != "none") { |
| 92 | deps += [ "${chip_root}/src/app/server" ] |
| 93 | } |
| 94 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 95 | if (chip_build_tests) { |
Rafał Kuźnia | 6b3ee1a | 2020-09-04 03:08:16 +0200 | [diff] [blame] | 96 | deps += [ "//src:tests" ] |
Austin Hsieh | c9c3b65 | 2021-09-24 06:52:56 -0700 | [diff] [blame] | 97 | if (current_os == "android") { |
| 98 | deps += [ "${chip_root}/build/chip/java/tests:java_build_test" ] |
| 99 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 100 | } |
| 101 | |
Michael Spang | bad533e | 2021-03-09 01:28:51 -0500 | [diff] [blame] | 102 | if (chip_with_lwip) { |
Michael Spang | e1c64e3 | 2021-06-21 14:53:44 -0400 | [diff] [blame] | 103 | deps += [ "${chip_root}/src/lwip" ] |
Michael Spang | bad533e | 2021-03-09 01:28:51 -0500 | [diff] [blame] | 104 | } |
| 105 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 106 | if (chip_build_tools) { |
| 107 | deps += [ |
Michael Spang | c8f7c69 | 2021-03-19 10:41:51 -0400 | [diff] [blame] | 108 | ":certification", |
Timothy Maes | 9e1ac48 | 2020-10-29 17:59:49 +0100 | [diff] [blame] | 109 | "${chip_root}/examples/shell/standalone:chip-shell", |
yunhanw-google | e430b1d | 2021-01-06 06:12:46 -0800 | [diff] [blame] | 110 | "${chip_root}/src/app/tests/integration:chip-im-initiator", |
| 111 | "${chip_root}/src/app/tests/integration:chip-im-responder", |
Andrei Litvin | 0a760e4 | 2022-02-22 17:07:31 -0500 | [diff] [blame] | 112 | "${chip_root}/src/lib/address_resolve:address-resolve-tool", |
Yufeng Wang | 4282a07 | 2020-12-08 08:58:46 -0800 | [diff] [blame] | 113 | "${chip_root}/src/messaging/tests/echo:chip-echo-requester", |
| 114 | "${chip_root}/src/messaging/tests/echo:chip-echo-responder", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 115 | "${chip_root}/src/qrcodetool", |
| 116 | "${chip_root}/src/setup_payload", |
Evgeny Margolis | 4d9f8c0 | 2022-01-25 20:28:43 -0800 | [diff] [blame] | 117 | "${chip_root}/src/tools/spake2p", |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 118 | ] |
Evgeny Margolis | f0e9f91 | 2021-05-13 16:02:38 -0700 | [diff] [blame] | 119 | if (chip_crypto == "openssl") { |
| 120 | deps += [ "${chip_root}/src/tools/chip-cert" ] |
| 121 | } |
Andrei Litvin | 2d86349 | 2020-10-02 17:28:58 -0400 | [diff] [blame] | 122 | if (chip_enable_python_modules) { |
Josh V [Apple] | 1ec6161 | 2021-08-18 12:52:27 -0700 | [diff] [blame] | 123 | if (enable_pylib) { |
| 124 | deps += [ "${chip_root}/src/pybindings/pycontroller" ] |
| 125 | } |
yunhanw-google | 90ea314 | 2020-10-01 13:53:26 -0700 | [diff] [blame] | 126 | deps += [ "${chip_root}/src/controller/python" ] |
| 127 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 128 | } |
Andrei Litvin | d74a0b6 | 2020-08-30 19:58:00 -0400 | [diff] [blame] | 129 | |
| 130 | if (current_os == "android") { |
| 131 | deps += [ |
Hui.Li-TCL | 62b337e | 2021-11-02 23:29:58 +0800 | [diff] [blame] | 132 | "${chip_root}/src/app/server/java", |
Andrei Litvin | d74a0b6 | 2020-08-30 19:58:00 -0400 | [diff] [blame] | 133 | "${chip_root}/src/controller/java", |
Hui.Li-TCL | 924f36e | 2021-09-30 20:51:41 +0800 | [diff] [blame] | 134 | "${chip_root}/src/platform/android:java", |
Andrei Litvin | d74a0b6 | 2020-08-30 19:58:00 -0400 | [diff] [blame] | 135 | "${chip_root}/src/setup_payload/java", |
| 136 | ] |
| 137 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 138 | } |
| 139 | |
Michael Spang | c8f7c69 | 2021-03-19 10:41:51 -0400 | [diff] [blame] | 140 | if (chip_build_tools) { |
| 141 | group("certification") { |
| 142 | data_deps = [ "${chip_root}/examples/chip-tool" ] |
| 143 | |
| 144 | if (chip_enable_python_modules) { |
Josh V [Apple] | 1ec6161 | 2021-08-18 12:52:27 -0700 | [diff] [blame] | 145 | if (enable_pylib) { |
| 146 | data_deps += [ "${chip_root}/src/pybindings/pycontroller" ] |
| 147 | } |
Michael Spang | c8f7c69 | 2021-03-19 10:41:51 -0400 | [diff] [blame] | 148 | data_deps += [ "${chip_root}/src/controller/python" ] |
| 149 | } |
| 150 | |
| 151 | write_runtime_deps = "${root_out_dir}/certification.runtime_deps" |
| 152 | } |
| 153 | } |
| 154 | |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 155 | group("fake_platform_tests") { |
| 156 | if (chip_link_tests) { |
| 157 | deps = [ "//src:fake_platform_tests_run" ] |
| 158 | } |
| 159 | } |
| 160 | |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 161 | group("check") { |
| 162 | if (chip_link_tests) { |
Sweety | c1fbb49 | 2021-07-20 20:28:07 +0530 | [diff] [blame] | 163 | deps = [ |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 164 | "//:fake_platform_tests", |
Sweety | c1fbb49 | 2021-07-20 20:28:07 +0530 | [diff] [blame] | 165 | "//scripts/build:build_examples.tests", |
Andrei Litvin | b519c8e | 2022-01-21 09:11:25 -0500 | [diff] [blame] | 166 | "//scripts/idl:idl.tests", |
Sweety | c1fbb49 | 2021-07-20 20:28:07 +0530 | [diff] [blame] | 167 | "//src:tests_run", |
| 168 | ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 169 | } |
| 170 | } |
| 171 | } else { |
Michael Spang | f1af8fc | 2020-07-29 14:25:47 -0400 | [diff] [blame] | 172 | # This is the unified build. Configure various real toolchains. |
Michael Spang | 09611bf | 2021-03-02 16:31:57 -0500 | [diff] [blame] | 173 | import("${chip_root}/build/chip/chip_build.gni") |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 174 | declare_args() { |
| 175 | # Set this to false to disable all builds by default. |
| 176 | enable_default_builds = true |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 177 | |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 178 | # Enable building for Android. |
| 179 | enable_android_builds = false |
| 180 | |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 181 | # Set this to true to enable TI builds by default. |
Michael Spang | 2891d6b | 2021-02-24 14:00:22 -0500 | [diff] [blame] | 182 | enable_ti_simplelink_builds = false |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 183 | |
jepenven-silabs | cec75ca | 2020-08-04 09:38:48 -0400 | [diff] [blame] | 184 | # Set this to true to enable efr32 builds by default. |
| 185 | enable_efr32_builds = false |
Timothy Maes | b5b3d38 | 2020-10-05 16:59:21 +0200 | [diff] [blame] | 186 | |
Praveen Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 187 | # Set this to true to enable p6 builds by default. |
| 188 | enable_p6_builds = false |
| 189 | |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 190 | # Set this to true to enable Qorvo qpg builds by default. |
| 191 | enable_qpg_builds = false |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 192 | |
| 193 | # Set this to true to enable k32w builds by default. |
| 194 | enable_k32w_builds = false |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | declare_args() { |
| 198 | # Enable building chip with clang. |
Michael Spang | cd0f611 | 2021-01-22 17:06:25 -0500 | [diff] [blame] | 199 | enable_host_clang_build = enable_default_builds && host_os != "win" |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 200 | |
| 201 | # Enable building chip with gcc. |
Michael Spang | cd0f611 | 2021-01-22 17:06:25 -0500 | [diff] [blame] | 202 | enable_host_gcc_build = enable_default_builds && host_os != "win" |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 203 | |
Michael Spang | a964fad | 2020-07-13 09:36:00 -0400 | [diff] [blame] | 204 | # Enable building chip with gcc & mbedtls. |
Michael Spang | cd0f611 | 2021-01-22 17:06:25 -0500 | [diff] [blame] | 205 | enable_host_gcc_mbedtls_build = enable_default_builds && host_os != "win" |
Michael Spang | a964fad | 2020-07-13 09:36:00 -0400 | [diff] [blame] | 206 | |
Evgeny Margolis | 1486eb7 | 2021-07-12 20:18:00 -0700 | [diff] [blame] | 207 | # Build the chip-cert tool. |
| 208 | enable_standalone_chip_cert_build = |
| 209 | enable_default_builds && host_os != "win" && chip_crypto == "openssl" |
| 210 | |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 211 | # Build the chip-tool example. |
Michael Spang | cd0f611 | 2021-01-22 17:06:25 -0500 | [diff] [blame] | 212 | enable_standalone_chip_tool_build = |
| 213 | enable_default_builds && host_os != "win" |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 214 | |
Vivien Nicolas | 87d46d5 | 2021-03-17 17:43:37 +0100 | [diff] [blame] | 215 | # Build the chip-tool-darwin example. |
| 216 | enable_standalone_chip_tool_darwin_build = |
| 217 | enable_default_builds && host_os == "mac" |
| 218 | |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 219 | # Build the shell example. |
Michael Spang | cd0f611 | 2021-01-22 17:06:25 -0500 | [diff] [blame] | 220 | enable_standalone_shell_build = enable_default_builds && host_os != "win" |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 221 | |
Vivien Nicolas | 280d80f | 2020-11-06 22:56:40 +0100 | [diff] [blame] | 222 | # Build the Linux all clusters app example. |
| 223 | enable_linux_all_clusters_app_build = |
Vivien Nicolas | 1b29655 | 2020-12-07 18:24:57 +0100 | [diff] [blame] | 224 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
Vivien Nicolas | 280d80f | 2020-11-06 22:56:40 +0100 | [diff] [blame] | 225 | |
Lazar Kovacic | 7fe8c92 | 2021-05-18 03:46:21 +0200 | [diff] [blame] | 226 | # Build the Linux tv app example. |
| 227 | enable_linux_tv_app_build = |
| 228 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
| 229 | |
Sharad Binjola | 2937f1a | 2021-08-24 14:25:16 -0700 | [diff] [blame] | 230 | # Build the Linux tv casting app example. |
| 231 | enable_linux_tv_casting_app_build = |
| 232 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
| 233 | |
Vivien Nicolas | 139e71d | 2021-02-16 19:12:41 +0100 | [diff] [blame] | 234 | # Build the Linux bridge app example. |
| 235 | enable_linux_bridge_app_build = |
| 236 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
| 237 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 238 | # Build the Linux lighting app example. |
| 239 | enable_linux_lighting_app_build = |
Vivien Nicolas | 1b29655 | 2020-12-07 18:24:57 +0100 | [diff] [blame] | 240 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 241 | |
chrisbeach59 | bb9a239 | 2021-07-26 10:01:46 -0400 | [diff] [blame] | 242 | # Build the Linux thermostat app example. |
| 243 | enable_linux_thermostat_app_build = |
| 244 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
| 245 | |
Dustin Crossman | b006321 | 2022-01-04 09:19:36 -0800 | [diff] [blame] | 246 | # Build the Linux door lock app example. |
| 247 | enable_linux_door_lock_app_build = |
| 248 | enable_default_builds && (host_os == "linux" || host_os == "mac") |
| 249 | |
Michael Spang | 2891d6b | 2021-02-24 14:00:22 -0500 | [diff] [blame] | 250 | # Build the cc13x2x7_26x2x7 lock app example. |
| 251 | enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 252 | |
jepenven-silabs | cec75ca | 2020-08-04 09:38:48 -0400 | [diff] [blame] | 253 | # Build the efr32 lock app example. |
| 254 | enable_efr32_lock_app_build = enable_efr32_builds |
Michael Spang | 0241373 | 2020-09-24 09:45:17 -0400 | [diff] [blame] | 255 | |
Praveen Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 256 | # Build the p6 lock app example. |
| 257 | enable_p6_lock_app_build = enable_p6_builds |
| 258 | |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 259 | # Build the qpgxxxx lock app example. |
Michael Spang | 706874a | 2021-07-02 21:45:45 -0400 | [diff] [blame] | 260 | enable_qpg_lock_app_build = enable_qpg_builds && !is_debug |
Timothy Maes | b5b3d38 | 2020-10-05 16:59:21 +0200 | [diff] [blame] | 261 | |
Michael Spang | 0241373 | 2020-09-24 09:45:17 -0400 | [diff] [blame] | 262 | # Build the efr32 lighting app example. |
| 263 | enable_efr32_lighting_app_build = enable_efr32_builds |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 264 | |
cecille | 3588d78 | 2021-04-09 14:03:54 -0400 | [diff] [blame] | 265 | # Build the efr32 window app example. |
| 266 | enable_efr32_window_app_build = enable_efr32_builds |
| 267 | |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 268 | # Build the k32w lighting app example. |
| 269 | enable_k32w_lighting_app_build = enable_k32w_builds |
| 270 | |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 271 | # Build the k32w lock app example. |
| 272 | enable_k32w_lock_app_build = enable_k32w_builds |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 273 | |
| 274 | # Build the k32w shell app example. |
| 275 | enable_k32w_shell_app_build = enable_k32w_builds |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 276 | |
| 277 | enable_fake_tests = enable_default_builds && host_os == "linux" |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 278 | } |
| 279 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 280 | if (enable_host_clang_build) { |
| 281 | chip_build("host_clang") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 282 | toolchain = "${build_root}/toolchain/host:${host_os}_${host_cpu}_clang" |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 283 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 284 | } |
| 285 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 286 | if (enable_host_gcc_build) { |
| 287 | chip_build("host_gcc") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 288 | toolchain = "${build_root}/toolchain/host:${host_os}_${host_cpu}_gcc" |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 289 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 290 | } |
| 291 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 292 | if (enable_host_gcc_mbedtls_build) { |
| 293 | chip_build("host_gcc_mbedtls") { |
| 294 | toolchain = "${chip_root}/config/mbedtls/toolchain:${host_os}_${host_cpu}_gcc_mbedtls" |
| 295 | } |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 296 | } |
| 297 | |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 298 | if (enable_android_builds) { |
| 299 | chip_build("android_arm") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 300 | toolchain = "${build_root}/toolchain/android:android_arm" |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | chip_build("android_arm64") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 304 | toolchain = "${build_root}/toolchain/android:android_arm64" |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | chip_build("android_x64") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 308 | toolchain = "${build_root}/toolchain/android:android_x64" |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | chip_build("android_x86") { |
Łukasz Duda | 4e1faf2 | 2021-01-27 17:47:25 +0100 | [diff] [blame] | 312 | toolchain = "${build_root}/toolchain/android:android_x86" |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 316 | if (enable_fake_tests) { |
| 317 | chip_build("fake_platform") { |
Andrei Litvin | 7ce0f47 | 2021-11-16 15:49:26 -0500 | [diff] [blame] | 318 | toolchain = "${build_root}/toolchain/fake:fake_${host_cpu}_gcc" |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 319 | } |
| 320 | } |
| 321 | |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 322 | standalone_toolchain = "${chip_root}/config/standalone/toolchain:standalone" |
Michael Spang | f92b73d | 2021-01-05 10:31:03 -0500 | [diff] [blame] | 323 | not_needed([ "standalone_toolchain" ]) # Might not be needed. |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 324 | |
Evgeny Margolis | 1486eb7 | 2021-07-12 20:18:00 -0700 | [diff] [blame] | 325 | if (enable_standalone_chip_cert_build) { |
| 326 | group("standalone_chip_cert") { |
| 327 | deps = [ "${chip_root}/src/tools/chip-cert(${standalone_toolchain})" ] |
| 328 | } |
| 329 | } |
| 330 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 331 | if (enable_standalone_chip_tool_build) { |
| 332 | group("standalone_chip_tool") { |
| 333 | deps = [ "${chip_root}/examples/chip-tool(${standalone_toolchain})" ] |
| 334 | } |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 335 | } |
| 336 | |
Vivien Nicolas | 87d46d5 | 2021-03-17 17:43:37 +0100 | [diff] [blame] | 337 | if (enable_standalone_chip_tool_darwin_build) { |
| 338 | group("standalone_chip_tool_darwin") { |
| 339 | deps = |
| 340 | [ "${chip_root}/examples/chip-tool-darwin(${standalone_toolchain})" ] |
| 341 | } |
| 342 | } |
| 343 | |
Michael Spang | 2891d6b | 2021-02-24 14:00:22 -0500 | [diff] [blame] | 344 | if (enable_cc13x2x7_26x2x7_lock_app_build) { |
| 345 | group("cc13x2x7_26x2x7_lock_app") { |
| 346 | deps = [ "${chip_root}/examples/lock-app/cc13x2x7_26x2x7(${chip_root}/config/cc13x2_26x2/toolchain:cc13x2x7_26x2x7_lock_app)" ] |
Seth Rickard | 4f0521f | 2021-01-12 16:06:52 -0600 | [diff] [blame] | 347 | } |
| 348 | } |
| 349 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 350 | if (enable_standalone_shell_build) { |
| 351 | group("standalone_shell") { |
| 352 | deps = |
| 353 | [ "${chip_root}/examples/shell/standalone(${standalone_toolchain})" ] |
| 354 | } |
| 355 | } |
| 356 | |
Vivien Nicolas | 280d80f | 2020-11-06 22:56:40 +0100 | [diff] [blame] | 357 | if (enable_linux_all_clusters_app_build) { |
| 358 | group("linux_all_clusters_app") { |
| 359 | deps = [ |
| 360 | "${chip_root}/examples/all-clusters-app/linux(${standalone_toolchain})", |
| 361 | ] |
| 362 | } |
| 363 | } |
| 364 | |
chrisbeach59 | bb9a239 | 2021-07-26 10:01:46 -0400 | [diff] [blame] | 365 | if (enable_linux_thermostat_app_build) { |
| 366 | group("linux_thermostat_app") { |
| 367 | deps = |
| 368 | [ "${chip_root}/examples/thermostat/linux(${standalone_toolchain})" ] |
| 369 | } |
| 370 | } |
| 371 | |
Lazar Kovacic | 7fe8c92 | 2021-05-18 03:46:21 +0200 | [diff] [blame] | 372 | if (enable_linux_tv_app_build) { |
| 373 | group("linux_tv_app") { |
| 374 | deps = [ "${chip_root}/examples/tv-app/linux(${standalone_toolchain})" ] |
| 375 | } |
| 376 | } |
| 377 | |
Sharad Binjola | 2937f1a | 2021-08-24 14:25:16 -0700 | [diff] [blame] | 378 | if (enable_linux_tv_casting_app_build) { |
| 379 | group("linux_tv_casting_app") { |
| 380 | deps = [ |
| 381 | "${chip_root}/examples/tv-casting-app/linux(${standalone_toolchain})", |
| 382 | ] |
| 383 | } |
| 384 | } |
| 385 | |
Vivien Nicolas | 139e71d | 2021-02-16 19:12:41 +0100 | [diff] [blame] | 386 | if (enable_linux_bridge_app_build) { |
| 387 | group("linux_bridge_app") { |
| 388 | deps = |
| 389 | [ "${chip_root}/examples/bridge-app/linux(${standalone_toolchain})" ] |
| 390 | } |
| 391 | } |
| 392 | |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 393 | if (enable_linux_lighting_app_build) { |
| 394 | group("linux_lighting_app") { |
| 395 | deps = [ |
| 396 | "${chip_root}/examples/lighting-app/linux(${standalone_toolchain})", |
| 397 | ] |
| 398 | } |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 399 | } |
| 400 | |
Dustin Crossman | b006321 | 2022-01-04 09:19:36 -0800 | [diff] [blame] | 401 | if (enable_linux_door_lock_app_build) { |
| 402 | group("linux_door_lock_app") { |
| 403 | deps = [ |
| 404 | "${chip_root}/examples/door-lock-app/linux(${standalone_toolchain})", |
| 405 | ] |
| 406 | } |
| 407 | } |
| 408 | |
jepenven-silabs | cec75ca | 2020-08-04 09:38:48 -0400 | [diff] [blame] | 409 | if (enable_efr32_lock_app_build) { |
| 410 | group("efr32_lock_app") { |
| 411 | deps = [ "${chip_root}/examples/lock-app/efr32(${chip_root}/config/efr32/toolchain:efr32_lock_app)" ] |
| 412 | } |
| 413 | } |
| 414 | |
Praveen Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 415 | if (enable_p6_lock_app_build) { |
| 416 | group("p6_lock_app") { |
| 417 | deps = [ "${chip_root}/examples/lock-app/p6(${chip_root}/config/p6/toolchain:p6_lock_app)" ] |
| 418 | } |
| 419 | } |
| 420 | |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 421 | if (enable_qpg_lock_app_build) { |
| 422 | group("qpg_lock_app") { |
| 423 | deps = [ "${chip_root}/examples/lock-app/qpg(${chip_root}/config/qpg/toolchain:qpg_lock_app)" ] |
Timothy Maes | b5b3d38 | 2020-10-05 16:59:21 +0200 | [diff] [blame] | 424 | } |
| 425 | } |
| 426 | |
Michael Spang | 0241373 | 2020-09-24 09:45:17 -0400 | [diff] [blame] | 427 | if (enable_efr32_lighting_app_build) { |
| 428 | group("efr32_lighting_app") { |
| 429 | deps = [ "${chip_root}/examples/lighting-app/efr32(${chip_root}/config/efr32/toolchain:efr32_lighting_app)" ] |
| 430 | } |
| 431 | } |
| 432 | |
cecille | 3588d78 | 2021-04-09 14:03:54 -0400 | [diff] [blame] | 433 | if (enable_efr32_window_app_build) { |
| 434 | group("efr32_window_app") { |
| 435 | deps = [ "${chip_root}/examples/window-app/efr32(${chip_root}/config/efr32/toolchain:efr32_window_app)" ] |
| 436 | } |
| 437 | } |
| 438 | |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 439 | if (enable_k32w_lighting_app_build) { |
| 440 | group("k32w_lighting_app") { |
Andrei Litvin | 41300eb | 2022-02-17 00:39:14 -0500 | [diff] [blame] | 441 | deps = [ "${chip_root}/examples/lighting-app/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lighting_app)" ] |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 442 | } |
| 443 | } |
| 444 | |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 445 | if (enable_k32w_lock_app_build) { |
| 446 | group("k32w_lock_app") { |
Andrei Litvin | 41300eb | 2022-02-17 00:39:14 -0500 | [diff] [blame] | 447 | deps = [ "${chip_root}/examples/lock-app/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_lock_app)" ] |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 448 | } |
| 449 | } |
| 450 | |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 451 | if (enable_k32w_shell_app_build) { |
| 452 | group("k32w_shell_app") { |
Andrei Litvin | 41300eb | 2022-02-17 00:39:14 -0500 | [diff] [blame] | 453 | deps = [ "${chip_root}/examples/shell/nxp/k32w/k32w0/(${chip_root}/config/k32w/toolchain:k32w_shell_app)" ] |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 454 | } |
| 455 | } |
| 456 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 457 | group("default") { |
| 458 | deps = [] |
| 459 | if (enable_host_clang_build) { |
Michael Spang | b1139f7 | 2020-12-01 16:06:36 -0500 | [diff] [blame] | 460 | deps += [ ":host_clang" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 461 | } |
| 462 | if (enable_host_gcc_build) { |
Michael Spang | b1139f7 | 2020-12-01 16:06:36 -0500 | [diff] [blame] | 463 | deps += [ ":host_gcc" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 464 | } |
Michael Spang | a964fad | 2020-07-13 09:36:00 -0400 | [diff] [blame] | 465 | if (enable_host_gcc_mbedtls_build) { |
Michael Spang | b1139f7 | 2020-12-01 16:06:36 -0500 | [diff] [blame] | 466 | deps += [ ":host_gcc_mbedtls" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 467 | } |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 468 | if (enable_android_builds) { |
| 469 | deps += [ |
Michael Spang | b1139f7 | 2020-12-01 16:06:36 -0500 | [diff] [blame] | 470 | ":android_arm", |
| 471 | ":android_arm64", |
| 472 | ":android_x64", |
| 473 | ":android_x86", |
Michael Spang | fdc49a3 | 2020-09-03 18:33:20 -0400 | [diff] [blame] | 474 | ] |
| 475 | } |
Evgeny Margolis | 1486eb7 | 2021-07-12 20:18:00 -0700 | [diff] [blame] | 476 | if (enable_standalone_chip_cert_build) { |
| 477 | deps += [ ":standalone_chip_cert" ] |
| 478 | } |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 479 | if (enable_standalone_chip_tool_build) { |
| 480 | deps += [ ":standalone_chip_tool" ] |
| 481 | } |
Vivien Nicolas | 87d46d5 | 2021-03-17 17:43:37 +0100 | [diff] [blame] | 482 | if (enable_standalone_chip_tool_darwin_build) { |
| 483 | deps += [ ":standalone_chip_tool_darwin" ] |
| 484 | } |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 485 | if (enable_standalone_shell_build) { |
| 486 | deps += [ ":standalone_shell" ] |
| 487 | } |
Vivien Nicolas | 280d80f | 2020-11-06 22:56:40 +0100 | [diff] [blame] | 488 | if (enable_linux_all_clusters_app_build) { |
| 489 | deps += [ ":linux_all_clusters_app" ] |
| 490 | } |
chrisbeach59 | bb9a239 | 2021-07-26 10:01:46 -0400 | [diff] [blame] | 491 | if (enable_linux_thermostat_app_build) { |
| 492 | deps += [ ":linux_thermostat_app" ] |
| 493 | } |
Lazar Kovacic | 7fe8c92 | 2021-05-18 03:46:21 +0200 | [diff] [blame] | 494 | if (enable_linux_tv_app_build) { |
| 495 | deps += [ ":linux_tv_app" ] |
| 496 | } |
Sharad Binjola | 2937f1a | 2021-08-24 14:25:16 -0700 | [diff] [blame] | 497 | if (enable_linux_tv_casting_app_build) { |
| 498 | deps += [ ":linux_tv_casting_app" ] |
| 499 | } |
Vivien Nicolas | 139e71d | 2021-02-16 19:12:41 +0100 | [diff] [blame] | 500 | if (enable_linux_bridge_app_build) { |
| 501 | deps += [ ":linux_bridge_app" ] |
| 502 | } |
Michael Spang | 7c8f19b | 2020-11-02 13:05:12 -0500 | [diff] [blame] | 503 | if (enable_linux_lighting_app_build) { |
| 504 | deps += [ ":linux_lighting_app" ] |
| 505 | } |
Dustin Crossman | b006321 | 2022-01-04 09:19:36 -0800 | [diff] [blame] | 506 | if (enable_linux_door_lock_app_build) { |
| 507 | deps += [ ":linux_door_lock_app" ] |
| 508 | } |
jepenven-silabs | cec75ca | 2020-08-04 09:38:48 -0400 | [diff] [blame] | 509 | if (enable_efr32_lock_app_build) { |
| 510 | deps += [ ":efr32_lock_app" ] |
| 511 | } |
Michael Spang | f8dc12e | 2021-02-02 21:36:46 -0500 | [diff] [blame] | 512 | if (enable_efr32_lighting_app_build) { |
| 513 | deps += [ ":efr32_lighting_app" ] |
| 514 | } |
cecille | 3588d78 | 2021-04-09 14:03:54 -0400 | [diff] [blame] | 515 | if (enable_efr32_window_app_build) { |
| 516 | deps += [ ":efr32_window_app" ] |
| 517 | } |
Praveen Chandran | 080ae57 | 2021-08-12 07:58:27 -0700 | [diff] [blame] | 518 | if (enable_p6_lock_app_build) { |
| 519 | deps += [ ":p6_lock_app" ] |
| 520 | } |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 521 | if (enable_k32w_lighting_app_build) { |
| 522 | deps += [ ":k32w_lighting_app" ] |
| 523 | } |
doru91 | 04ac26b | 2020-10-13 18:23:28 +0300 | [diff] [blame] | 524 | if (enable_k32w_lock_app_build) { |
| 525 | deps += [ ":k32w_lock_app" ] |
| 526 | } |
Michael Spang | 18a5a40 | 2021-06-15 23:34:41 -0400 | [diff] [blame] | 527 | if (enable_k32w_shell_app_build) { |
| 528 | deps += [ ":k32w_shell_app" ] |
| 529 | } |
Timothy Maes | 2478e02 | 2021-07-02 04:03:46 +0200 | [diff] [blame] | 530 | if (enable_qpg_lock_app_build) { |
| 531 | deps += [ ":qpg_lock_app" ] |
Michael Spang | f8dc12e | 2021-02-02 21:36:46 -0500 | [diff] [blame] | 532 | } |
Michael Spang | 2891d6b | 2021-02-24 14:00:22 -0500 | [diff] [blame] | 533 | if (enable_cc13x2x7_26x2x7_lock_app_build) { |
| 534 | deps += [ ":cc13x2x7_26x2x7_lock_app" ] |
Michael Spang | f8dc12e | 2021-02-02 21:36:46 -0500 | [diff] [blame] | 535 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 536 | } |
| 537 | |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 538 | group("check") { |
| 539 | deps = [] |
| 540 | if (enable_host_clang_build) { |
| 541 | deps += [ ":check_host_clang" ] |
| 542 | } |
| 543 | if (enable_host_gcc_build) { |
| 544 | deps += [ ":check_host_gcc" ] |
| 545 | } |
| 546 | if (enable_host_gcc_mbedtls_build) { |
| 547 | deps += [ ":check_host_gcc_mbedtls" ] |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 548 | } |
C Freeman | 79c9315 | 2021-08-18 00:20:05 -0400 | [diff] [blame] | 549 | if (enable_fake_tests) { |
| 550 | deps += [ ":check_fake_platform" ] |
| 551 | } |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 552 | } |
| 553 | } |