xref: /aosp_15_r20/external/pigweed/pw_i2c_mcuxpresso/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2022 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14import("//build_overrides/pigweed.gni")
15
16import("$dir_pw_build/target_types.gni")
17import("$dir_pw_docgen/docs.gni")
18import("$dir_pw_third_party/mcuxpresso/mcuxpresso.gni")
19import("$dir_pw_unit_test/test.gni")
20
21config("default_config") {
22  include_dirs = [ "public" ]
23}
24
25if (pw_third_party_mcuxpresso_SDK != "") {
26  pw_source_set("pw_i2c_mcuxpresso") {
27    public_configs = [ ":default_config" ]
28    public = [ "public/pw_i2c_mcuxpresso/initiator.h" ]
29    public_deps = [
30      "$dir_pw_chrono:system_clock",
31      "$dir_pw_i2c:initiator",
32      "$dir_pw_status",
33      "$dir_pw_sync:interrupt_spin_lock",
34      "$dir_pw_sync:lock_annotations",
35      "$dir_pw_sync:mutex",
36      "$dir_pw_sync:timed_thread_notification",
37      "$pw_third_party_mcuxpresso_SDK",
38    ]
39    sources = [ "initiator.cc" ]
40  }
41
42  pw_source_set("i3c_initiator") {
43    public_configs = [ ":default_config" ]
44    public = [
45      "public/pw_i2c_mcuxpresso/i3c_ccc.h",
46      "public/pw_i2c_mcuxpresso/i3c_initiator.h",
47    ]
48    public_deps = [
49      "$dir_pw_chrono:system_clock",
50      "$dir_pw_i2c:initiator",
51      "$dir_pw_status",
52      "$dir_pw_sync:interrupt_spin_lock",
53      "$dir_pw_sync:lock_annotations",
54      "$dir_pw_sync:mutex",
55      "$dir_pw_sync:timed_thread_notification",
56      "$pw_third_party_mcuxpresso_SDK",
57    ]
58    sources = [ "i3c_initiator.cc" ]
59  }
60}
61
62pw_test("initiator_test") {
63  enable_if =
64      pw_third_party_mcuxpresso_SDK == "//targets/mimxrt595_evk_freertos:sdk" &&
65      (pw_toolchain_SCOPE.name == "mimxrt595_evk_freertos_debug" ||
66       pw_toolchain_SCOPE.name == "mimxrt595_evk_freertos_size_optimized" ||
67       pw_toolchain_SCOPE.name == "mimxrt595_evk_freertos_speed_optimized")
68  sources = [ "initiator_test.cc" ]
69  deps = [
70    ":pw_i2c_mcuxpresso",
71    "//targets/mimxrt595_evk_freertos:sdk",
72  ]
73}
74
75pw_doc_group("docs") {
76  sources = [ "docs.rst" ]
77}
78
79pw_test_group("tests") {
80  tests = [ ":initiator_test" ]
81}
82