1# Copyright 2023 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5assert(is_fuchsia) 6 7declare_args() { 8 # The target API level for this repository. Embedders should override this 9 # value to specify the API level the packages produced from this repository 10 # should be targeting, e.g. in their top-level //.gn file. A value of -1 11 # means that no API level will be passed to the tools that consumes it. 12 fuchsia_target_api_level = 16 13 14 # Path to the fuchsia SDK. This is intended for use in other templates & 15 # rules to reference the contents of the fuchsia SDK. 16 fuchsia_sdk = "//third_party/fuchsia-sdk/sdk" 17 18 # ID uniquely identifying the Fuchsia IDK build. This is exposed as a 19 # property so it can be used to locate images and packages on GCS and 20 # as a marker to indicate the "version" of the IDK. 21 # Defaults to the id found in the manifest.json file of the SDK. 22 fuchsia_sdk_id = "" 23} 24 25# The SDK manifest file. This is useful to include as a dependency 26# for some targets in order to cause a rebuild when the version of the 27# SDK is changed. 28fuchsia_sdk_manifest_file = "${fuchsia_sdk}/meta/manifest.json" 29 30# fuchsia_tool_dir is used to specify the directory in the SDK to locate 31# tools for the host cpu architecture. If the host_cpu is not recognized, 32# then tool dir defaults to x64. 33fuchsia_tool_dir = "${fuchsia_sdk}/tools/${host_cpu}" 34 35if (fuchsia_sdk_id == "") { 36 # Note: If we need to expose more than just the id in the future, 37 # we should consider exposing the entire json object for the metadata vs. 38 # adding a bunch of variables. 39 _meta = read_file(fuchsia_sdk_manifest_file, "json") 40 fuchsia_sdk_id = _meta.id 41} 42 43declare_args() { 44 # Specify a readelf_exec path to use. If not specified, the host's system 45 # executable will be used. Passed to populate_build_id_dir.py and 46 # prepare_package_inputs.py via the --readelf-exec flag. 47 # Must be a GN path (not an absolute path) since it is adjusted with 48 # rebase_path(). 49 if (!defined(fuchsia_sdk_readelf_exec)) { 50 fuchsia_sdk_readelf_exec = "" 51 } 52} 53 54# Copy from third_party/fuchsia-gn-sdk/src/gn_configs.gni to avoid importing 55# files from //third_party/ in //build/. 56# Note, `current_cpu` should always exist in the //build/ tree, so the 57# `target_cpu` fallback has been removed. 58fuchsia_arch_root = 59 "${fuchsia_sdk}/obj/${target_cpu}-api-${fuchsia_target_api_level}" 60