Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / 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
18 import("${chip_root}/build/chip/tests.gni")
19 import("${chip_root}/src/ble/ble.gni")
20 import("${chip_root}/src/lwip/lwip.gni")
21 import("${chip_root}/src/platform/device.gni")
22
23 declare_args() {
24   # Build monolithic test library.
25   chip_monolithic_tests = false
26 }
27
28 config("includes") {
29   include_dirs = [
30     "include",
31     ".",
32     "${root_gen_dir}/include",
33   ]
34
35   defines = [ "CHIP_HAVE_CONFIG_H=1" ]
36 }
37
38 if (chip_build_tests) {
39   import("${chip_root}/build/chip/chip_test_group.gni")
40
41   chip_test_group("tests") {
42     deps = [
43       "${chip_root}/src/app/tests",
44       "${chip_root}/src/credentials/tests",
45       "${chip_root}/src/crypto/tests",
46       "${chip_root}/src/inet/tests",
47       "${chip_root}/src/lib/asn1/tests",
48       "${chip_root}/src/lib/core/tests",
49       "${chip_root}/src/lib/mdns/minimal/core/tests",
50       "${chip_root}/src/lib/mdns/minimal/responders/tests",
51       "${chip_root}/src/lib/mdns/minimal/tests",
52       "${chip_root}/src/lib/support/tests",
53       "${chip_root}/src/messaging/tests",
54       "${chip_root}/src/protocols/bdx/tests",
55       "${chip_root}/src/protocols/secure_channel/tests",
56       "${chip_root}/src/system/tests",
57       "${chip_root}/src/transport/retransmit/tests",
58       "${chip_root}/src/transport/tests",
59     ]
60
61     if (current_os != "zephyr") {
62       deps += [
63         "${chip_root}/src/lib/mdns/minimal/records/tests",
64         "${chip_root}/src/setup_payload/tests",
65         "${chip_root}/src/transport/raw/tests",
66       ]
67     }
68
69     if (chip_device_platform != "none") {
70       deps += [ "${chip_root}/src/lib/mdns/minimal/tests" ]
71     }
72
73     if (chip_device_platform != "esp32") {
74       deps += [ "${chip_root}/src/platform/tests" ]
75     }
76
77     if (chip_config_network_layer_ble) {
78       deps += [ "${chip_root}/src/ble/tests" ]
79     }
80
81     if (chip_with_lwip && chip_device_platform != "esp32") {
82       deps += [ "${chip_root}/src/lwip/tests" ]
83     }
84
85     if (current_os != "zephyr" && chip_device_platform != "esp32") {
86       deps += [ "${chip_root}/src/lib/shell/tests" ]
87     }
88
89     if (chip_monolithic_tests) {
90       build_monolithic_library = true
91       output_name = "libCHIP_tests"
92       output_dir = "${root_out_dir}/lib"
93     }
94   }
95
96   if (chip_enable_happy_tests) {
97     group("happy_tests") {
98       deps = [
99         "${chip_root}/src/test_driver/happy/tests/standalone/inet:inet_tests",
100       ]
101     }
102   }
103 }