third_party.pigweed.src/BUILDCONFIG.gn
Wyatt Hepler f6f74f4a79 pw_build: Configurable Python and proto toolchains
- Rename pw_toolchain/dummy to pw_toolchain/default to make its intended
  purpose clear. Keep pw_toolchain/dummy around for compatibility.
- Create a template that generates non-C++ toolchains. This is used for
  non-C++ tasks like Python and proto. GN parses build files differently
  in the default toolchain (all targets are instantiated), so the
  these toolchains can be used when that is not desired.
- Make pw_python_package's toolchain configurable with the
  pw_build_PYTHON_TOOLCHAIN arg.
- Make pw_proto_library's toolchain configurable with the
  pw_protobuf_compiler_TOOLCHAIN arg.

Requires: pigweed-internal:11680
Change-Id: I0aad049c605906b77c58b93a08efc63a648947ee
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/40763
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2021-04-29 20:30:56 +00:00

29 lines
1.3 KiB
Plaintext

# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# This BUILDCONFIG file tells GN how to build upstream Pigweed. When starting a
# new project, you'll need to copy this file to your project and then modify it
# to fit your needs. Due to the way Pigweed handles file imports, you won't be
# able to simply import this file in your own BUILDCONFIG.gn.
# This is imported into a scope so as not to pollute the global variable space.
_pigweed_directory = {
import("//build_overrides/pigweed.gni")
}
# The default toolchain is not used in Pigweed builds, so it is set to a
# toolchain that cannot compile C/C++ code. The top-level BUILD.gn should stamp
# a group with all of the build targets and their toolchains.
set_default_toolchain("${_pigweed_directory.dir_pw_toolchain}/default")