blob: 72b68fef120846b207b8bb927eb40ce44011dcc2 [file] [log] [blame]
# 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.
# gn-format disable
import("//build_overrides/pigweed.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_toolchain/arm_gcc/toolchains.gni")
import("$dir_pw_toolchain/generate_toolchain.gni")
# Toolchain for generating upstream Pigweed documentation.
generate_toolchain("docs") {
# Use the Cortex M4 toolchain for regular pw_size_report targets.
forward_variables_from(pw_toolchain_arm_gcc.cortex_m4_size_optimized,
"*",
[
"defaults",
"name",
])
defaults = {
_base_toolchain = pw_toolchain_arm_gcc.cortex_m4_size_optimized
forward_variables_from(_base_toolchain.defaults, "*")
# This is the docs target.
pw_docgen_BUILD_DOCS = true
_arm_bloaty_config = "$dir_pw_boot_armv7m/bloaty_config.bloaty"
pw_bloat_BLOATY_CONFIG = _arm_bloaty_config
# Toolchains to compare in documentation size reports.
pw_bloat_TOOLCHAINS = [
{
name = "arm-none-eabi-gcc -Og -mcpu=cortex-m4"
target = "$dir_pw_toolchain:arm_gcc_cortex_m4_debug"
bloaty_config = _arm_bloaty_config
},
{
name = "arm-none-eabi-gcc -Os -mcpu=cortex-m4"
target = "$dir_pw_toolchain:arm_gcc_cortex_m4_size_optimized"
bloaty_config = _arm_bloaty_config
},
{
name = "arm-none-eabi-gcc -O2 -mcpu=cortex-m4"
target = "$dir_pw_toolchain:arm_gcc_cortex_m4_speed_optimized"
bloaty_config = _arm_bloaty_config
},
]
}
}
pw_doc_group("target_docs") {
sources = [ "target_docs.rst" ]
}