blob: edf540a50ecf54ff5dfbcb0d218fc22554205197 [file] [log] [blame]
Armando Montanez70045e22021-12-08 15:44:08 -08001# Copyright 2021 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.
14
15import("//build_overrides/pigweed.gni")
16
Armando Montaneza398cd12021-12-13 10:57:41 -080017import("$dir_pw_build/module_config.gni")
Armando Montanez70045e22021-12-08 15:44:08 -080018import("$dir_pw_build/target_types.gni")
19import("$dir_pw_docgen/docs.gni")
Wyatt Hepler70a62102022-02-11 15:14:35 -080020import("$dir_pw_third_party/stm32cube/stm32cube.gni")
Armando Montanez70045e22021-12-08 15:44:08 -080021
Armando Montanez70045e22021-12-08 15:44:08 -080022declare_args() {
Armando Montaneza398cd12021-12-13 10:57:41 -080023 # The build target that overrides the default configuration options for this
24 # module. This should point to a source set that provides defines through a
25 # public config (which may -include a file or add defines directly).
26 pw_sys_io_stm32cube_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
Armando Montanez70045e22021-12-08 15:44:08 -080027}
28
29config("public_includes") {
30 include_dirs = [ "public" ]
31}
32
Armando Montaneza398cd12021-12-13 10:57:41 -080033pw_source_set("config") {
34 public_deps = [ pw_sys_io_stm32cube_CONFIG ]
35 public = [ "pw_sys_io_stm32cube_private/config.h" ]
36 visibility = [ ":*" ]
37}
38
Armando Montanez70045e22021-12-08 15:44:08 -080039pw_source_set("pw_sys_io_stm32cube") {
Armando Montanez70045e22021-12-08 15:44:08 -080040 public_configs = [ ":public_includes" ]
41 public_deps = [
42 "$dir_pw_preprocessor",
43 "$dir_pw_status",
Armando Montanez70045e22021-12-08 15:44:08 -080044 ]
Wyatt Hepler70a62102022-02-11 15:14:35 -080045 if (dir_pw_third_party_stm32cube != "") {
46 public_deps += [ "$dir_pw_third_party/stm32cube" ]
47 }
Armando Montanez70045e22021-12-08 15:44:08 -080048 public = [ "public/pw_sys_io_stm32cube/init.h" ]
49 sources = [ "sys_io.cc" ]
50 deps = [
Armando Montaneza398cd12021-12-13 10:57:41 -080051 ":config",
Armando Montanez70045e22021-12-08 15:44:08 -080052 "$dir_pw_sys_io:default_putget_bytes",
53 "$dir_pw_sys_io:facade",
54 ]
55}
Armando Montaneza398cd12021-12-13 10:57:41 -080056
57pw_doc_group("docs") {
58 sources = [ "docs.rst" ]
59}