blob: d97d96c0e323d94f76df7e6af836e940173fca9d [file] [log] [blame]
Alexei Frolov1a82c142019-10-31 17:37:12 -07001# 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
15import("modules.gni")
16
17# Default configs to use for all binary build targets.
18_default_common_binary_configs = [
19 "$dir_pw_build:reduced_size",
20 "$dir_pw_build:strict_warnings",
21]
22
23set_defaults("executable") {
24 configs = _default_common_binary_configs
25}
26
27set_defaults("static_library") {
28 configs = _default_common_binary_configs
29}
30
31set_defaults("shared_library") {
32 configs = _default_common_binary_configs
33}
34
35set_defaults("source_set") {
36 configs = _default_common_binary_configs
37}
38
39declare_args() {
Alexei Frolove899dcf2019-11-13 14:49:14 -080040 # Path to the Pigweed variables config file for the build target.
Alexei Frolov02dfcc42019-11-08 15:51:51 -080041 #
Alexei Frolove899dcf2019-11-13 14:49:14 -080042 # When this is changed, you must run `ninja -t clean` to remove any files from
43 # the previous target's build before building again.
44 pw_target_config = "$dir_pigweed/targets/host/host.gni"
Alexei Frolov1a82c142019-10-31 17:37:12 -070045}
46
Alexei Frolove899dcf2019-11-13 14:49:14 -080047import(pw_target_config)
48
49assert(pw_target_toolchain != "",
50 "Build target must provide its own toolchain.")
Alexei Frolov02dfcc42019-11-08 15:51:51 -080051set_default_toolchain(pw_target_toolchain)