blob: 5eeadad3f9b706560daa3c4e1a00490337d4d018 [file]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file directs GN to all the other key files.
# The location of the build configuration file.
buildconfig = "//build/config/BUILDCONFIG.gn"
# The secondary source root is a parallel directory tree where GN build files
# are placed when they can not be placed directly in the source tree, e.g. for
# third party source trees.
secondary_source = "//build/secondary/"
# https://fxbug.dev/363930634: set this to true once all actions in the build have been fixed,
# of if we decide to create depfile parent directories in Ninja.
no_stamp_files = true
# Only instantiate targets in the default toolchain that are dependencies
# of any target defined in //BUILD.gn, to significantly reduce the size of the
# GN build graph and of the Ninja build plan.
root_patterns = [
# All targets defined in //BUILD.gn
"//:*",
]
# The executable used to execute scripts in action and exec_script. This is
# often an interpreter for projects that use a primary scripting language. In
# this project, we use several different kinds of programs including scripts in
# different languages and native binaries. An empty script_executable string
# tells GN to directly run the "script".
script_executable = ""
# Require Ninja 1.10.0 to support multiple outputs from a rule with a depfile.
ninja_required_version = "1.10.0"
# Enable checking for all source code we control.
no_check_targets = [ "//third_party/*" ]
# Use of `exec_script()` is discouraged for performance reasons.
# See: https://fuchsia.dev/fuchsia-src/development/build/gn_concepts/templates#exec-script
exec_script_whitelist = [
"//build/config/fuchsia/platform_version.gni",
"//build/config/clang/clang_toolchain_info.gni",
"//build/icu/build_config.gni",
"//build/toolchain/default_concurrent_jobs.gni",
"//build/toolchain/zircon/zircon_toolchain.gni",
"//zircon/kernel/arch/x86/phys/BUILD.gn",
"//build/git/git_revisions.gni",
]
check_system_includes = true
# Causes a Clang compilation database to be written to
# $root_build_dir/compile_commands.json. It will contain the compilation
# commands for these patterns and all of their recursive dependencies.
export_compile_commands = [ "//:default" ]
# These arguments override the default values for items in a declare_args block.
# "gn args" in turn can override these.
#
# In general the value for a build arg in a declare_args block should be the
# default. In some cases, a third party dependency will want different defaults
# for being built as part of Fuchsia vs. being built standalone. In this case,
# the Fuchsia defaults should go here. There should be no overrides here for
# values declared in the main Fuchsia repository.
#
# Important note for defining defaults: This file is executed before the
# BUILDCONFIG.gn file. That file sets up the global variables like "target_os".
# This means that the default_args can not depend on the platform, architecture,
# or other build parameters. If you really need that, the other repo should
# define a flag that toggles on a behavior that implements the additional logic
# required by Fuchsia to set the variables.
default_args = {
# Specify Pigweed backends for Fuchsia.
pw_assert_BACKEND = "//third_party/pigweed/backends/pw_assert"
pw_chrono_SYSTEM_CLOCK_BACKEND =
"//third_party/pigweed/src/pw_chrono_stl:system_clock"
pw_chrono_SYSTEM_TIMER_BACKEND =
"//third_party/pigweed/src/pw_chrono_stl:system_timer"
pw_log_BACKEND = "//third_party/pigweed/backends/pw_log"
pw_sync_BINARY_SEMAPHORE_BACKEND =
"//third_party/pigweed/src/pw_sync_stl:binary_semaphore_backend"
pw_sync_INTERRUPT_SPIN_LOCK_BACKEND =
"//third_party/pigweed/src/pw_sync_stl:interrupt_spin_lock"
pw_sync_MUTEX_BACKEND = "//third_party/pigweed/src/pw_sync_stl:mutex_backend"
pw_sync_THREAD_NOTIFICATION_BACKEND = "//third_party/pigweed/src/pw_sync:binary_semaphore_thread_notification_backend"
pw_sync_TIMED_THREAD_NOTIFICATION_BACKEND = "//third_party/pigweed/src/pw_sync:binary_semaphore_timed_thread_notification_backend"
pw_sys_io_BACKEND = "//third_party/pigweed/src/pw_sys_io_stdio"
pw_thread_SLEEP_BACKEND = "//third_party/pigweed/src/pw_thread_stl:sleep"
# Pigweed configs for Fuchsia.
pw_function_CONFIG =
"//third_party/pigweed/src/pw_function:enable_dynamic_allocation"
# Some Pigweed module implementations need to be link dependencies to avoid
# circular dependencies.
pw_build_LINK_DEPS = [
"//third_party/pigweed/src/pw_assert:impl",
"//third_party/pigweed/src/pw_log:impl",
]
# Configures Pigweed to use Fuchsia source directly instead of Pigweed's copy.
dir_pw_third_party_fuchsia = "//"
# Configures Pigweed to use Fuchsia's boringssl target.
pw_third_party_boringssl_ALIAS = "//third_party/boringssl"
# Configures Pigweed to use Fuchsia's Emboss checkout.
dir_pw_third_party_emboss = "//third_party/github.com/google/emboss/src"
pw_third_party_emboss_USE_GEN_SOURCES = "true"
# Enable usage of the pw_async Pigweed module.
pw_async_EXPERIMENTAL_MODULE_VISIBILITY = [
"//third_party/pigweed/backends/pw_async_fuchsia:*",
"//third_party/pigweed:*",
"//src/connectivity/bluetooth/core/bt-host/*",
]
pw_async_TASK_BACKEND = "//third_party/pigweed/backends/pw_async_fuchsia:task"
pw_async_FAKE_DISPATCHER_BACKEND =
"//third_party/pigweed/backends/pw_async_fuchsia:fake_dispatcher"
pw_build_PYTHON_BUILD_VENV =
"//third_party/pigweed:fuchsia_pigweed_python_venv"
# Use protoc from the Fuchsia build for Pigweed
pw_protobuf_compiler_PROTOC_TARGET = "//third_party/protobuf:protoc"
pw_protobuf_compiler_PROTOC_BINARY = "host_x64/protoc"
dir_pw_third_party_protobuf = "//third_party/protobuf/src"
# Use the in-tree protobuf Python package when running protoc.
pw_protobuf_compiler_PROTOC_PYTHON_DEPS = [
"//third_party/pigweed/backends/pw_protobuf_compiler:protoc_python_package",
]
# Don't generate .pyi files for pw_proto_library targets since it
# requires protoc-gen-mypy.
pw_protobuf_compiler_GENERATE_PYTHON_TYPE_HINTS = false
# Settings for pigweed's CHRE module.
dir_pw_third_party_chre = "//third_party/chre/src"
pw_chre_CONFIG = "//third_party/chre:chre_config"
pw_chre_PLATFORM_BACKEND = "//third_party/pigweed/src/pw_chre:chre_backend"
pw_chre_PLATFORM_BACKEND_HEADERS =
"//third_party/pigweed/src/pw_chre:chre_backend_headers"
pw_unit_test_MAIN = "//src/lib/fxl/test:gtest_main"
pw_unit_test_GOOGLETEST_BACKEND = "//third_party/googletest:gmock_no_testonly"
pw_unit_test_BACKEND = "//third_party/pigweed/src/pw_unit_test:googletest"
pw_unit_test_TESTONLY = true
# pw_unit_test says claims it only depends on googletest, but nevertheless
# includes some GMock headers.
pw_third_party_googletest_ALIAS = "//third_party/googletest:gmock_no_testonly"
# Point Pigweed's ICU target to Fuchsia's checkout.
dir_pw_third_party_icu = "//third_party/icu/default"
# This is a Pigweed build configuration argument that removes default configs
# from pw_* targets. Due to linker errors ("undefined symbol: typeinfo") when
# using source_set with pw_source_set, we need to remove the reduced_size
# config that adds the "-fno-rtti" flag.
remove_default_configs = [ "//third_party/pigweed/src/pw_build:reduced_size" ]
}