1# Copyright 2024 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 5# This is the BUILDCONFIG for building partition_alloc as a standalone project. 6# 7# The config is based on: 8# - skia: //gn/BUILDCONFIG.gn 9# - chromium: //build/config/BUILDCONFIG.gn 10 11build_with_chromium = false 12is_asan = false 13 14# It's best to keep the names and defaults of is_foo flags consistent with: 15# - Chrome 16# - Skia. 17 18declare_args() { 19 is_official_build = false 20 is_component_build = false 21 dcheck_always_on = true 22} 23 24declare_args() { 25 is_debug = !is_official_build 26} 27 28# Platform detection defaults: 29if (target_os == "") { 30 target_os = host_os 31} 32if (current_os == "") { 33 current_os = target_os 34} 35if (target_cpu == "") { 36 target_cpu = host_cpu 37} 38if (target_cpu == "x86_64") { 39 target_cpu = "x64" 40} 41if (current_cpu == "") { 42 current_cpu = target_cpu 43} 44 45is_android = current_os == "android" 46is_chromeos = false 47is_fuchsia = current_os == "fuchsia" 48is_ios = current_os == "ios" 49is_linux = current_os == "linux" 50is_mac = current_os == "mac" 51is_nacl = false 52is_win = current_os == "win" || current_os == "winuwp" 53is_cast_android = false 54is_castos = false 55is_chromeos_ash = false 56is_cronet_build = false 57enable_expensive_dchecks = false 58dcheck_is_configurable = false 59can_unwind_with_frame_pointers = false 60is_posix = !is_win && !is_fuchsia 61is_apple = is_mac || is_ios 62 63# TODO(crbug.com/41481467): Consider expanding the standalone configuration for 64# additional OSes. 65assert(is_linux, "PartitionAlloc standalone only support Linux for now") 66is_clang = true 67 68# A component is either: 69# - A static library (is_component_build=false) 70# - A shared library (is_component_build=true) 71template("component") { 72 if (is_component_build) { 73 _component_mode = "shared_library" 74 } else { 75 _component_mode = "static_library" 76 } 77 78 target(_component_mode, target_name) { 79 forward_variables_from(invoker, "*") 80 } 81} 82 83# Default configs 84default_configs = [ 85 "//gn/partition_alloc:default", 86 "//gn/partition_alloc:no_exceptions", 87 "//gn/partition_alloc:no_rtti", 88] 89 90if (!is_debug) { 91 default_configs += [ 92 "//gn/partition_alloc:optimize", 93 "//gn/partition_alloc:NDEBUG", 94 ] 95} 96 97# GCC-like toolchains, including Clang. 98set_default_toolchain("//gn/toolchain:clang") 99default_toolchain_name = "clang" 100 101set_defaults("source_set") { 102 configs = default_configs 103} 104 105set_defaults("component") { 106 configs = default_configs 107} 108