|
| 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/ti_simplelink_sdk.gni") |
| 18 | +import("${build_root}/config/defaults.gni") |
| 19 | +import("${chip_root}/src/platform/device.gni") |
| 20 | +import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") |
| 21 | +import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") |
| 22 | + |
| 23 | +assert(current_os == "freertos") |
| 24 | + |
| 25 | +project_dir = "${chip_root}/examples/lock-app/cc32xx" |
| 26 | + |
| 27 | +ti_simplelink_sdk("sdk") { |
| 28 | + include_dirs = [ "${project_dir}/main/include" ] |
| 29 | + |
| 30 | + defines = [] |
| 31 | + if (is_debug) { |
| 32 | + defines += [ "BUILD_RELEASE=0" ] |
| 33 | + } else { |
| 34 | + defines += [ "BUILD_RELEASE=1" ] |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +ti_sysconfig("sysconfig") { |
| 39 | + sources = [ "${project_dir}/chip.syscfg" ] |
| 40 | + outputs = [ |
| 41 | + "ti_drivers_net_wifi_config.c", |
| 42 | + "ti_net_config.c", |
| 43 | + "ti_drivers_config.c", |
| 44 | + "ti_drivers_config.h", |
| 45 | + ] |
| 46 | +} |
| 47 | + |
| 48 | +source_set("lock_app_sdk") { |
| 49 | + defines = [] |
| 50 | + |
| 51 | + configs -= [ "${build_root}/config/compiler:std_default" ] |
| 52 | + configs += [ ":sdk_posix_config" ] |
| 53 | + |
| 54 | + sources = [ |
| 55 | + "${chip_root}/src/platform/cc32xx/Logging.cpp", |
| 56 | + "${project_dir}/main/cc32xxWifiInit.c", |
| 57 | + "${project_dir}/main/main.cpp", |
| 58 | + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/lwip_if.c", |
| 59 | + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/utils_if.c", |
| 60 | + "${ti_simplelink_sdk_root}/examples/rtos/common/ifmod/wifi_if.c", |
| 61 | + ] |
| 62 | + |
| 63 | + include_dirs = [ |
| 64 | + "${project_dir}/include", |
| 65 | + "${project_dir}/main", |
| 66 | + "${project_dir}/main/ifmod/", |
| 67 | + "${chip_root}/src/platform/cc32xx", |
| 68 | + ] |
| 69 | + |
| 70 | + deps = [ |
| 71 | + ":sdk", |
| 72 | + ":sysconfig", |
| 73 | + "${chip_root}/examples/lock-app/lock-common", |
| 74 | + "${chip_root}/src/lib", |
| 75 | + "${chip_root}/src/setup_payload", |
| 76 | + ] |
| 77 | +} |
| 78 | + |
| 79 | +ti_simplelink_executable("lock_app") { |
| 80 | + defines = [] |
| 81 | + output_name = "chip-${ti_simplelink_board}-lock-example.out" |
| 82 | + |
| 83 | + sources = [ |
| 84 | + "${project_dir}/main/AppTask.cpp", |
| 85 | + "${project_dir}/main/BoltLockManager.cpp", |
| 86 | + "${project_dir}/main/CXXExceptionStubs.cpp", |
| 87 | + "${project_dir}/main/ZclCallbacks.cpp", |
| 88 | + ] |
| 89 | + |
| 90 | + deps = [ |
| 91 | + ":lock_app_sdk", |
| 92 | + ":sdk", |
| 93 | + ":sysconfig", |
| 94 | + "${chip_root}/examples/lock-app/lock-common", |
| 95 | + "${chip_root}/src/lib", |
| 96 | + "${chip_root}/src/setup_payload", |
| 97 | + ] |
| 98 | + |
| 99 | + include_dirs = [ |
| 100 | + "${project_dir}", |
| 101 | + "${project_dir}/main", |
| 102 | + ] |
| 103 | + |
| 104 | + cflags = [ |
| 105 | + "-Wno-implicit-fallthrough", |
| 106 | + "-Wno-sign-compare", |
| 107 | + "-Wconversion", |
| 108 | + ] |
| 109 | + |
| 110 | + output_dir = root_out_dir |
| 111 | +} |
| 112 | + |
| 113 | +group("cc32xx") { |
| 114 | + deps = [ ":lock_app" ] |
| 115 | +} |
| 116 | + |
| 117 | +group("default") { |
| 118 | + deps = [ ":cc32xx" ] |
| 119 | +} |
0 commit comments