Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / lighting-app / k32w / BUILD.gn
1 # Copyright (c) 2021 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/chip.gni")
16 import("//build_overrides/k32w_sdk.gni")
17 import("//build_overrides/openthread.gni")
18
19 import("${k32w_sdk_build_root}/k32w_executable.gni")
20 import("${k32w_sdk_build_root}/k32w_sdk.gni")
21
22 assert(current_os == "freertos")
23
24 k32w_platform_dir = "${chip_root}/examples/platform/k32w"
25
26 k32w_sdk("sdk") {
27   include_dirs = [
28     "main/include",
29     "main",
30     "${k32w_platform_dir}/app/project_include",
31     "${k32w_platform_dir}/app/support",
32     "${chip_root}/examples/lighting-app/lighting-common",
33     "${chip_root}/src/app/util",
34     "${chip_root}/src/app/server",
35     "${k32w_platform_dir}/util/include",
36   ]
37
38   sources = [
39     "${k32w_platform_dir}/app/project_include/CHIPProjectConfig.h",
40     "${k32w_platform_dir}/app/project_include/FreeRTOSConfig.h",
41     "${k32w_platform_dir}/app/project_include/OpenThreadConfig.h",
42     "main/include/app_config.h",
43   ]
44
45   public_deps =
46       [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform" ]
47
48   defines = []
49   if (is_debug) {
50     defines += [ "BUILD_RELEASE=0" ]
51   } else {
52     defines += [ "BUILD_RELEASE=1" ]
53   }
54 }
55
56 k32w_executable("light_app") {
57   output_name = "chip-k32w061-light-example"
58
59   sources = [
60     "${k32w_platform_dir}/util/LEDWidget.cpp",
61     "${k32w_platform_dir}/util/include/LEDWidget.h",
62     "main/AppTask.cpp",
63     "main/LightingManager.cpp",
64     "main/ZclCallbacks.cpp",
65     "main/include/AppEvent.h",
66     "main/include/AppTask.h",
67     "main/include/LightingManager.h",
68     "main/main.cpp",
69   ]
70
71   deps = [
72     ":sdk",
73     "${chip_root}/examples/common/QRCode",
74     "${chip_root}/examples/lighting-app/lighting-common",
75     "${chip_root}/src/lib",
76     "${chip_root}/third_party/mbedtls:mbedtls",
77     "${k32w_platform_dir}/app/support:freertos_mbedtls_utils",
78     "${openthread_root}:libopenthread-cli-ftd",
79     "${openthread_root}:libopenthread-ftd",
80   ]
81
82   output_dir = root_out_dir
83
84   ldscript = "${k32w_platform_dir}/app/ldscripts/chip-k32w061-linker.ld"
85
86   ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
87 }
88
89 group("k32w") {
90   deps = [ ":light_app" ]
91 }
92
93 group("default") {
94   deps = [ ":k32w" ]
95 }