Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / lighting-app / 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_overrides/build.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/openthread.gni")
18 import("//build_overrides/qpg6100_sdk.gni")
19
20 import("${build_root}/config/defaults.gni")
21 import("${qpg6100_sdk_build_root}/qpg6100_executable.gni")
22 import("${qpg6100_sdk_build_root}/qpg6100_sdk.gni")
23
24 assert(current_os == "freertos")
25
26 qpg6100_project_dir = "${chip_root}/examples/lighting-app/qpg6100"
27 examples_plat_dir = "${chip_root}/examples/platform/qpg6100"
28
29 qpg6100_sdk("sdk") {
30   include_dirs = [
31     "${chip_root}/src/platform/qpg6100",
32     "${examples_plat_dir}/project_include",
33   ]
34
35   sources = [
36     "${examples_plat_dir}/app/include/Service.h",
37     "${examples_plat_dir}/project_include/CHIPProjectConfig.h",
38   ]
39
40   defines = []
41 }
42
43 qpg6100_executable("lighting_app") {
44   include_dirs = []
45   defines = []
46   output_name = "chip-qpg6100-lighting-example.out"
47
48   public_deps = [
49     ":sdk",
50     "${chip_root}/examples/lighting-app/lighting-common/",
51     "${chip_root}/src/lib",
52     "${chip_root}/src/setup_payload",
53     "${chip_root}/third_party/openthread/platforms:libopenthread-platform",
54     "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
55     "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
56     "${chip_root}/third_party/openthread/repo:libopenthread-ftd",
57   ]
58
59   include_dirs += [
60     "${qpg6100_project_dir}/include/",
61     "${chip_root}/src/app/util",
62     "${chip_root}/src/app/server",
63     "${examples_plat_dir}",
64     "${examples_plat_dir}/app/include",
65   ]
66
67   sources = [
68     "${examples_plat_dir}/app/Service.cpp",
69     "${examples_plat_dir}/app/main.cpp",
70     "src/AppTask.cpp",
71     "src/LightingManager.cpp",
72     "src/ZclCallbacks.cpp",
73   ]
74
75   output_dir = root_out_dir
76
77   ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"
78
79   ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
80 }
81
82 group("qpg6100") {
83   deps = [ ":lighting_app" ]
84 }
85
86 group("default") {
87   deps = [ ":qpg6100" ]
88 }