# Copyright 2018 The Hafnium Authors. # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/BSD-3-Clause. # Configuration of the build toolchain. declare_args() { # The name of the project being built. project = "reference" # This default path is overriden from the Makefile based on # the toolchain_lib arg passed through gn. toolchain_lib = rebase_path("//prebuilts/linux-x64/clang/lib64/clang/12.0.5/include") # Whether to build against the platform for embedded images consisting of # include paths and defines. This is also used for host targets that simulate # an embedded image. use_platform = false # Whether assertions are included in the build, this is overriden from the Makefile # based on the enable_assertions arg passed through gn enable_assertions = 1 } # Check that we support the attempted build. assert(host_os == "linux", "Only linux builds are currently supported.") # Setup the standard variables. if (target_os == "") { target_os = host_os } if (target_cpu == "") { target_cpu = host_cpu } if (current_os == "") { current_os = target_os } if (current_cpu == "") { current_cpu = target_cpu } assert(target_os == host_os, "Cross compiles not yet supported.") assert(target_cpu == host_cpu, "Cross compiles not yet supported.") # All binary targets will get this list of configs by default. _shared_binary_target_configs = [ "//build:compiler_defaults" ] # If it's not building a host utility, it's building against the platform so apply the configuration. if (use_platform) { _shared_binary_target_configs += [ "//build:platform" ] } # Apply that default list to the binary target types. set_defaults("executable") { configs = _shared_binary_target_configs } set_defaults("static_library") { configs = _shared_binary_target_configs } set_defaults("shared_library") { configs = _shared_binary_target_configs } set_defaults("source_set") { configs = _shared_binary_target_configs } # The default toolchain is the target toolchain for building utilities and tests. set_default_toolchain("//build/toolchain:host_clang")