blob: 6b8f85e25f8393552a5e524936a4295ad236898c [file] [log] [blame]
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if (is_mac || is_ios) {
import("//build/config/ios/ios_sdk.gni") # For use_ios_simulator
}
declare_args() {
# Enable the optional type profiler in Clang, which will tag heap allocations
# with the allocation type.
use_clang_type_profiler = false
# Enable Link Time Optimzations. This significantly slows down linking but
# results in a smaller binary.
enable_lto = true
# Generate code with instrumentation for code coverage generation using LLVM.
enable_coverage = false
# Set this flag to enable bitcode. Only valid for iOS ARM builds.
enable_bitcode = false
# Set this flag to cause bitcode to be marker only.
bitcode_marker = false
# Set this flag to strip .so files.
stripped_symbols = !is_debug
}
declare_args() {
# The version of Xcode used to archive a release application with embedded
# bitcode must be greater than or equal to the version of the toolchain
# that created the bitcode in Flutter.framework. This means that when we build
# the framework with embedded bitcode, we must use the Xcode toolchain and
# its version must be less than or equal to what we expect our developers to be using.
# Unfortunately, using the Xcode toolchain is not compatible with GOMA.
#
# The failure mode for this arises when a developer attempts to archive an application
# for publication to the store with embedded bitcode.
#
# Since we do not support publishing debug or profile builds, we use
# bitcode_marker which is intrinsically faster to build and does not introduce
# compatibility concerns between toolchains, meaning we can use
# a GOMA enabled Clang.
#
# TODO(gw280): Once our own copy of clang 12 is capable of building for arm64 simulator,
# we can safely remove the requirement that we use xcode for arm64 simulator builds.
if (is_mac || is_ios) {
use_xcode = (enable_bitcode && !bitcode_marker) || (use_ios_simulator && target_cpu == "arm64")
} else {
use_xcode = false
}
}