|
| 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 | + |
| 15 | +import("//build_overrides/build.gni") |
| 16 | +import("//build_overrides/chip.gni") |
| 17 | +import("//build_overrides/openthread.gni") |
| 18 | +import("//build_overrides/ti_simplelink_sdk.gni") |
| 19 | + |
| 20 | +import("${build_root}/config/defaults.gni") |
| 21 | + |
| 22 | +import("${chip_root}/src/platform/device.gni") |
| 23 | + |
| 24 | +import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") |
| 25 | +import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") |
| 26 | + |
| 27 | +assert(current_os == "freertos") |
| 28 | + |
| 29 | +project_dir = "${chip_root}/examples/light-switch-app/cc13x4_26x4" |
| 30 | + |
| 31 | +ti_simplelink_sdk("sdk") { |
| 32 | + include_dirs = [ "${project_dir}/include" ] |
| 33 | + public_configs = [ ":light-switch_app_config" ] |
| 34 | +} |
| 35 | + |
| 36 | +ti_sysconfig("sysconfig") { |
| 37 | + sources = [ "${project_dir}/chip.syscfg" ] |
| 38 | + |
| 39 | + outputs = [ |
| 40 | + "ti_radio_config.c", |
| 41 | + "ti_radio_config.h", |
| 42 | + "ti_drivers_config.c", |
| 43 | + "ti_drivers_config.h", |
| 44 | + "ti_ble_config.c", |
| 45 | + "ti_ble_config.h", |
| 46 | + "ti_dmm_application_policy.c", |
| 47 | + "ti_dmm_application_policy.h", |
| 48 | + |
| 49 | + # CCFG generation disabled for OTA-able application |
| 50 | + #"ti_devices_config.c", |
| 51 | + #"ti_devices_config.h", |
| 52 | + ] |
| 53 | + |
| 54 | + public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] |
| 55 | + |
| 56 | + cflags = [ |
| 57 | + "-Wno-comment", |
| 58 | + "@" + rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_compiler.opt", |
| 59 | + root_build_dir), |
| 60 | + ] |
| 61 | +} |
| 62 | + |
| 63 | +ti_simplelink_executable("light-switch_app") { |
| 64 | + output_name = "chip-${ti_simplelink_board}-light-switch-example.out" |
| 65 | + |
| 66 | + sources = [ |
| 67 | + "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", |
| 68 | + "${chip_root}/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.cpp", |
| 69 | + "${project_dir}/src/AppTask.cpp", |
| 70 | + "${project_dir}/src/BindingHandler.cpp", |
| 71 | + "${project_dir}/src/LightSwitchManager.cpp", |
| 72 | + "${project_dir}/src/ZclCallbacks.cpp", |
| 73 | + "${project_dir}/src/main.cpp", |
| 74 | + ] |
| 75 | + |
| 76 | + public = [ |
| 77 | + "${chip_root}/src/platform/cc13xx_26xx/DefaultTestEventTriggerDelegate.h", |
| 78 | + ] |
| 79 | + |
| 80 | + deps = [ |
| 81 | + ":sdk", |
| 82 | + ":sysconfig", |
| 83 | + "${chip_root}/examples/light-switch-app/light-switch-common", |
| 84 | + "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", |
| 85 | + "${chip_root}/src/lib", |
| 86 | + "${chip_root}/third_party/openthread:openthread", |
| 87 | + ] |
| 88 | + defines = [] |
| 89 | + if (custom_factory_data) { |
| 90 | + defines += [ "CC13XX_26XX_FACTORY_DATA" ] |
| 91 | + } |
| 92 | + |
| 93 | + if (chip_enable_icd_server) { |
| 94 | + defines += [ "TI_ICD_ENABLE_SERVER" ] |
| 95 | + } |
| 96 | + |
| 97 | + include_dirs = [ |
| 98 | + "${project_dir}", |
| 99 | + "${chip_root}/examples/providers/", |
| 100 | + ] |
| 101 | + |
| 102 | + cflags = [ |
| 103 | + "-Wno-implicit-fallthrough", |
| 104 | + "-Wno-sign-compare", |
| 105 | + "-Wconversion", |
| 106 | + ] |
| 107 | + |
| 108 | + output_dir = root_out_dir |
| 109 | +} |
| 110 | + |
| 111 | +group("cc13x4_26x4") { |
| 112 | + deps = [ ":light-switch_app" ] |
| 113 | +} |
| 114 | + |
| 115 | +group("default") { |
| 116 | + deps = [ ":cc13x4_26x4" ] |
| 117 | +} |
0 commit comments