xref: /aosp_15_r20/external/pigweed/third_party/pico_sdk/src/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.
14
15import("//build_overrides/pi_pico.gni")
16import("//build_overrides/pigweed.gni")
17
18import("$dir_pw_build/target_types.gni")
19
20# TODO(amontanez): If a successor to the RP2040 comes out, this might need to
21# be a little smarter about what code is pulled in.
22group("pico_sdk") {
23  public_deps = [
24    "common",
25    "rp2040",
26    "rp2_common",
27  ]
28}
29
30config("elf2uf2_configs") {
31  include_dirs = [ "$PICO_SRC_DIR/src/common/boot_uf2/include" ]
32  cflags_cc = [ "-std=gnu++14" ]
33  cflags = [
34    "-Wno-reorder-ctor",
35    "-Wno-unused-variable",
36  ]
37}
38
39pw_executable("elf2uf2") {
40  configs = [
41    ":elf2uf2_configs",
42    "${PICO_ROOT}/gn:disable_elf2uf2_warnings",
43    "${PICO_ROOT}/gn:disable_warnings",
44  ]
45  sources = [ "$PICO_SRC_DIR/tools/elf2uf2/main.cpp" ]
46}
47