blob: 9383f60b8429315ad3c232ad250cd1ca127efdb9 [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
Rob Mohr49de4922019-12-10 20:10:41 -080015import("$dir_pw_docgen/docs.gni")
16
Alexei Frolov1a82c142019-10-31 17:37:12 -070017# Standard compiler flags to reduce output binary size.
18config("reduced_size") {
19 cflags = [
20 "-fno-common",
21 "-fno-exceptions",
22 "-ffunction-sections",
23 "-fdata-sections",
24 ]
25 cflags_cc = [ "-fno-rtti" ]
26}
27
28config("strict_warnings") {
29 cflags = [
30 "-Wall",
31 "-Wextra",
Keir Mierle243e32a2019-11-05 10:29:26 -080032
Wyatt Hepler979890d2019-11-06 17:17:45 -080033 # Make all warnings errors, except for the exemptions below.
34 "-Werror",
35 "-Wno-error=cpp", # preprocessor #warning statement
36 "-Wno-error=deprecated-declarations", # [[deprecated]] attribute
Alexei Frolov1a82c142019-10-31 17:37:12 -070037 ]
Wyatt Hepler1919c642019-12-06 10:06:13 -080038 cflags_cc = [ "-Wnon-virtual-dtor" ]
Alexei Frolov1a82c142019-10-31 17:37:12 -070039}
40
Wyatt Hepler818e3312020-01-16 14:19:21 -080041config("cpp11") {
42 cflags_cc = [ "-std=c++11" ]
43}
44
45config("cpp14") {
46 cflags_cc = [ "-std=c++14" ]
47}
48
Alexei Frolov1a82c142019-10-31 17:37:12 -070049config("cpp17") {
Wyatt Hepler979890d2019-11-06 17:17:45 -080050 cflags_cc = [
51 "-std=c++17",
52
53 # Allow uses of the register keyword, which may appear in C headers.
54 "-Wno-register",
55 ]
Alexei Frolov1a82c142019-10-31 17:37:12 -070056}
57
Rob Mohr49de4922019-12-10 20:10:41 -080058pw_doc_group("docs") {
59 sources = [
60 "docs.rst",
61 ]
62}
Alexei Frolovc15a9882019-12-23 14:29:02 -080063
64# Pool to limit a single thread to download external Go packages at a time.
65pool("go_download_pool") {
66 depth = 1
67}