Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / lock-app / cc13x2x7_26x2x7 / BUILD.gn
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("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni")
23 import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")
24
25 assert(current_os == "freertos")
26
27 project_dir = "${chip_root}/examples/lock-app/cc13x2x7_26x2x7"
28
29 ti_simplelink_sdk("sdk") {
30   include_dirs = [ "${project_dir}/main/include" ]
31
32   defines = []
33   if (is_debug) {
34     defines += [ "BUILD_RELEASE=0" ]
35   } else {
36     defines += [ "BUILD_RELEASE=1" ]
37   }
38 }
39
40 ti_sysconfig("sysconfig") {
41   sources = [ "${project_dir}/chip.syscfg" ]
42   outputs = [
43     "ti_devices_config.c",
44     "ti_radio_config.c",
45     "ti_radio_config.h",
46     "ti_drivers_config.c",
47     "ti_drivers_config.h",
48     "ti_ble_config.c",
49     "ti_ble_config.h",
50     "ti_dmm_application_policy.c",
51     "ti_dmm_application_policy.h",
52
53     # disabled until upstream generation is aligned
54     #"tiop_config.h",
55     #"tiop_config.c",
56
57     # not traditional source files
58     #"ti_utils_build_linker.cmd.genlibs",
59     #"syscfg_c.rov.xs",
60     #"ti_utils_runtime_model.gv",
61     #"ti_utils_runtime_Makefile",
62     #"ti_ble_app_config.opt",
63     #"ti_build_config.opt",
64   ]
65   public_configs = [ ":sdk_dmm_config" ]
66
67   cflags = [
68     "-Wno-comment",
69     "@" + rebase_path("${target_gen_dir}/sysconfig/ti_ble_app_config.opt",
70                       root_build_dir),
71     "@" + rebase_path("${target_gen_dir}/sysconfig/ti_build_config.opt",
72                       root_build_dir),
73   ]
74 }
75
76 ti_simplelink_executable("lock_app") {
77   include_dirs = [
78     "${chip_root}/src/app/util",
79     "${chip_root}/src/app/server",
80     "${project_dir}",
81     "${project_dir}/main",
82     "${project_dir}/main/include",
83   ]
84   defines = []
85   output_name = "chip-${ti_simplelink_board}-lock-example.out"
86
87   public_deps = [
88     ":sdk",
89     ":sysconfig",
90     "${chip_root}/examples/lock-app/lock-common",
91     "${chip_root}/src/lib",
92     "${openthread_root}:libopenthread-cli-ftd",
93   ]
94
95   sources = [
96     "${project_dir}/main/AppTask.cpp",
97     "${project_dir}/main/BoltLockManager.cpp",
98     "${project_dir}/main/ZclCallbacks.cpp",
99     "${project_dir}/main/main.cpp",
100   ]
101
102   cflags = [
103     "-Wno-implicit-fallthrough",
104     "-Wno-sign-compare",
105   ]
106
107   output_dir = root_out_dir
108
109   ldscript = "${ti_simplelink_sdk_root}/source/ti/dmm/apps/common/freertos/cc13x2x7_cc26x2x7.lds"
110
111   ldflags = [
112     "-L${ti_simplelink_sdk_root}/source",
113     rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_linker.cmd.genlibs",
114                 root_build_dir),
115     "-T" + rebase_path(ldscript, root_build_dir),
116   ]
117 }
118
119 group("cc13x2x7_26x2x7") {
120   deps = [ ":lock_app" ]
121 }
122
123 group("default") {
124   deps = [ ":cc13x2x7_26x2x7" ]
125 }