c634817d5e7e1939d738ad0bf48b1d493442dab2
[platform/upstream/connectedhomeip.git] / examples / shell / qpg6100 / 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/config/defaults.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/qpg6100_sdk.gni")
18 import("${qpg6100_sdk_build_root}/qpg6100_executable.gni")
19 import("${qpg6100_sdk_build_root}/qpg6100_sdk.gni")
20
21 assert(current_os == "freertos")
22
23 examples_plat_dir = "${chip_root}/examples/platform/qpg6100"
24
25 qpg6100_sdk("sdk") {
26   include_dirs = [
27     "${chip_root}/src/platform/qpg6100",
28     "${examples_plat_dir}/project_include",
29     "${chip_root}/src/app/util",
30   ]
31
32   sources = [ "${examples_plat_dir}/project_include/CHIPProjectConfig.h" ]
33
34   defines = []
35   if (is_debug) {
36     defines += [ "BUILD_RELEASE=0" ]
37   } else {
38     defines += [ "BUILD_RELEASE=1" ]
39   }
40 }
41
42 qpg6100_executable("shell_qpg6100") {
43   include_dirs = []
44   defines = []
45   output_name = "shell-qpg6100.out"
46
47   public_deps = [
48     ":sdk",
49     "${chip_root}/examples/shell/shell_common",
50     "${chip_root}/src/lib",
51     "${chip_root}/src/lib/shell",
52     "${chip_root}/src/setup_payload",
53
54     #    OpenThread to be enabled
55     #    https://github.com/project-chip/connectedhomeip/issues/293
56   ]
57
58   include_dirs += [ "${chip_root}/src/app/util" ]
59
60   sources = [
61     "${examples_plat_dir}/project_include/CHIPProjectConfig.h",
62     "${examples_plat_dir}/util/streamer/streamer_qpg6100.cpp",
63     "main.cpp",
64   ]
65
66   output_dir = root_out_dir
67
68   ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"
69
70   ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
71   defines = [
72     "QPG6100_SHELL_STREAMER",
73     "SHELL_STREAMER_APP_SPECIFIC",
74   ]
75 }
76
77 group("qpg6100") {
78   deps = [ ":shell_qpg6100" ]
79 }
80
81 group("default") {
82   deps = [ ":qpg6100" ]
83 }