blob: b7c9ae48e9af74d3559e8593815c0e4037d5e6b6 [file] [log] [blame]
Alexei Frolove899dcf2019-11-13 14:49:14 -08001# Copyright 2019 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
15# This file defines default values for all of the build variables used by
16# Pigweed.
17#
18# Each individual variable can be overriden by a target to configure the system
19# to build for it. This is done in a .gni file specific to the target by first
20# importing this file, then changing the variables as desired.
21
Alexei Frolov76b05452019-12-11 14:10:37 -080022# Whether to build host-side tooling.
Alexei Frolovca9cf602019-12-26 13:00:03 -080023pw_build_host_tools = false
Alexei Frolov76b05452019-12-11 14:10:37 -080024
Alexei Frolove899dcf2019-11-13 14:49:14 -080025# Options which configure the executable targets created in Pigweed builds.
26pw_executable_config = {
27 # The name of the GN target type used to build Pigweed executables.
28 #
29 # If this is a custom template, the .gni file containing the template must
Armando Montaneza69244e2019-11-15 11:25:10 -080030 # be imported at the top of the target configuration file to make it globally
31 # available.
Alexei Frolove899dcf2019-11-13 14:49:14 -080032 target_type = "executable"
33
34 # Path to an instantiation of the "linker_script" GN template defining the
35 # linker script configuration for the target.
36 linker_script_target = ""
37
38 # Path to the Bloaty configuration file that defines the memory layout and
39 # capacities for the target binaries.
40 bloaty_config_file = ""
41}
42
43# Default toolchain for the build target.
44#
45# If this is changed, you must run `ninja -t clean` to remove any files from
46# the previous toolchain's build before building again.
47pw_target_toolchain = ""
48
Alexei Frolov3fde6b12019-12-18 16:13:38 -080049# List of toolchains to use in pw_toolchain_size_report templates.
50#
51# Each entry is a scope containing the following variables:
52#
53# name: Human-readable toolchain name.
54# target: GN target that defines the toolchain.
55# linker_script: Optional path to a linker script file to build for the
56# toolchain's target.
57# bloaty_config: Optional Bloaty confirugation file defining the memory
58# layout of the binaries as specified in the linker script.
59#
60# If this list is empty, pw_toolchain_size_report targets become no-ops.
61pw_size_report_toolchains = []
62
Alexei Frolove899dcf2019-11-13 14:49:14 -080063# Implementation of a main function for "pw_test" unit test binaries.
Keir Mierleda0bccb2020-01-17 13:51:35 -080064pw_unit_test_main = "$dir_pw_unit_test:simple_printing_main"
Wyatt Hepler09517ed2019-11-14 12:43:26 -080065
Alexei Frolov8403f0a2019-11-20 13:57:54 -080066# Path to a test runner to automatically run unit tests after they are built.
Wyatt Hepler09517ed2019-11-14 12:43:26 -080067#
Alexei Frolov8403f0a2019-11-20 13:57:54 -080068# If set, the pw_test() template creates an action that invokes the test runner
69# on each test executable. If unset, the pw_test() template only creates a test
70# executable target.
Wyatt Hepler09517ed2019-11-14 12:43:26 -080071#
Alexei Frolov8403f0a2019-11-20 13:57:54 -080072# This should only be enabled for targets which support parallelized running of
73# unit tests, such as desktops with multiple cores.
74pw_automatic_test_runner = ""
Armando Montanez68de0712019-11-14 18:29:39 -080075
Alexei Frolov942adf02019-12-11 17:07:28 -080076# Languages for which to generate protobuf code. These are used by the
77# pw_proto_library template to determine which build targets to create.
78#
79# Supported languages:
Alexei Frolovdef14712019-12-23 13:03:32 -080080# "cc", "go"
81pw_protobuf_langs = [
82 "cc",
83 "go",
84]
Alexei Frolov942adf02019-12-11 17:07:28 -080085
Armando Montanez68de0712019-11-14 18:29:39 -080086################################# BACKENDS #####################################
87
Alexei Frolov8403f0a2019-11-20 13:57:54 -080088# This section of the file defines empty variables for each of the Pigweed
Armando Montanez68de0712019-11-14 18:29:39 -080089# facades that expect a backend. This allows minimal breakages when adding new
90# facades. Instead of GN always halting due to encountering an undefined
91# variable, GN will only emit an error if something in the build depends on the
92# empty (but defined) variable.
93#
94# All of these should default to empty strings. For target-specific defaults,
Armando Montanez70095662020-01-09 14:25:04 -080095# modify these variables in a target configuration file.
96
Keir Mierle3cee8792020-01-22 17:08:13 -080097# Backend for the pw_assert module.
98dir_pw_assert_backend = ""
99
Armando Montanez70095662020-01-09 14:25:04 -0800100# Backend for the pw_boot module.
101dir_pw_boot_backend = ""
102
103# Backend for the pw_cpu_exception module.
104dir_pw_cpu_exception_backend = ""
Armando Montanez68de0712019-11-14 18:29:39 -0800105
Armando Montanez04c56ae2019-12-12 14:34:05 -0800106# Backend for the pw_dumb_io module.
Armando Montanez68de0712019-11-14 18:29:39 -0800107dir_pw_dumb_io_backend = ""
Armando Montanez5104cd62019-12-10 14:36:43 -0800108
Keir Mierleaf5e3582019-12-30 13:11:05 -0800109# Backend for the pw_log module.
110dir_pw_log_backend = ""
111
Armando Montanez70095662020-01-09 14:25:04 -0800112############################## MODULE CONFIGS ##################################
113
114# Module configuration options for pw_boot_armv7m.
115pw_boot_armv7m_config = {
116 # C Preprocessor defines used for linker script configuration.
117 defines = []
118}