1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2017 The ANGLE Project Authors. All rights reserved. 2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file. 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard Workerdeclare_args() { 6*8975f5c5SAndroid Build Coastguard Worker build_with_chromium = false 7*8975f5c5SAndroid Build Coastguard Worker ignore_elf32_limitations = true 8*8975f5c5SAndroid Build Coastguard Worker 9*8975f5c5SAndroid Build Coastguard Worker use_system_xcode = "" 10*8975f5c5SAndroid Build Coastguard Worker 11*8975f5c5SAndroid Build Coastguard Worker # If true, it assumes that //third_party/abseil-cpp is an available 12*8975f5c5SAndroid Build Coastguard Worker # dependency for googletest. 13*8975f5c5SAndroid Build Coastguard Worker gtest_enable_absl_printers = false 14*8975f5c5SAndroid Build Coastguard Worker 15*8975f5c5SAndroid Build Coastguard Worker # Set to default here so that it can be set via gn args 16*8975f5c5SAndroid Build Coastguard Worker use_cxx17 = false 17*8975f5c5SAndroid Build Coastguard Worker} 18*8975f5c5SAndroid Build Coastguard Worker 19*8975f5c5SAndroid Build Coastguard Workerif (host_os == "mac" && use_system_xcode == "") { 20*8975f5c5SAndroid Build Coastguard Worker _result = exec_script("//build/mac/should_use_hermetic_xcode.py", 21*8975f5c5SAndroid Build Coastguard Worker [ target_os ], 22*8975f5c5SAndroid Build Coastguard Worker "value") 23*8975f5c5SAndroid Build Coastguard Worker 24*8975f5c5SAndroid Build Coastguard Worker assert(_result != 2, 25*8975f5c5SAndroid Build Coastguard Worker "Do not allow building targets with the default" + 26*8975f5c5SAndroid Build Coastguard Worker "hermetic toolchain if the minimum OS version is not met.") 27*8975f5c5SAndroid Build Coastguard Worker assert(_result != 3, 28*8975f5c5SAndroid Build Coastguard Worker "iOS does not support building with a hermetic toolchain. " + 29*8975f5c5SAndroid Build Coastguard Worker "Please install Xcode.") 30*8975f5c5SAndroid Build Coastguard Worker 31*8975f5c5SAndroid Build Coastguard Worker use_system_xcode = _result != 1 32*8975f5c5SAndroid Build Coastguard Worker} 33*8975f5c5SAndroid Build Coastguard Worker 34*8975f5c5SAndroid Build Coastguard Workerenable_java_templates = true 35*8975f5c5SAndroid Build Coastguard Worker 36*8975f5c5SAndroid Build Coastguard Worker# Build with fewer Android dependencies 37*8975f5c5SAndroid Build Coastguard Workerlimit_android_deps = true 38*8975f5c5SAndroid Build Coastguard Worker 39*8975f5c5SAndroid Build Coastguard Worker# Standalone ANGLE is used in places that are extremely performance sensitive, 40*8975f5c5SAndroid Build Coastguard Worker# such as the system graphics driver on Android. ANGLE validates arguments at 41*8975f5c5SAndroid Build Coastguard Worker# the API boundary and assumes that all bounds, et cetera are valid elsewhere 42*8975f5c5SAndroid Build Coastguard Worker# in internal code. 43*8975f5c5SAndroid Build Coastguard Worker# 44*8975f5c5SAndroid Build Coastguard Worker# Unfortunately, this means the compiler cannot optimize out the vast majority 45*8975f5c5SAndroid Build Coastguard Worker# of hardening checks. To ensure performance remains competitive, drop the 46*8975f5c5SAndroid Build Coastguard Worker# libc++ hardening checks, since ANGLE already makes no security guarantees in 47*8975f5c5SAndroid Build Coastguard Worker# these situations. 48*8975f5c5SAndroid Build Coastguard Workerif (is_win) { 49*8975f5c5SAndroid Build Coastguard Worker # TODO(https://crbug.com/1418717): ANGLE uses Chromium's abseil-cpp directory. 50*8975f5c5SAndroid Build Coastguard Worker # Since Abseil does not mark symbols as exported, Chromium uses an alternate 51*8975f5c5SAndroid Build Coastguard Worker # approach to scrape the symbols that need to be exported and generates .def 52*8975f5c5SAndroid Build Coastguard Worker # files that the ANGLE build reuses. 53*8975f5c5SAndroid Build Coastguard Worker # 54*8975f5c5SAndroid Build Coastguard Worker # However, these symbol names include libc++ types, and libc++ hardening 55*8975f5c5SAndroid Build Coastguard Worker # affects ABI, so ANGLE and Chromium's libc++ hardening modes need to remain 56*8975f5c5SAndroid Build Coastguard Worker # in sync on Windows. This is a bit of a hack but "OK" since the performance 57*8975f5c5SAndroid Build Coastguard Worker # concerns for standalone ANGLE builds are not relevant on Windows. 58*8975f5c5SAndroid Build Coastguard Worker enable_safe_libcxx = true 59*8975f5c5SAndroid Build Coastguard Worker} else if (is_linux) { 60*8975f5c5SAndroid Build Coastguard Worker # https://anglebug.com/40096878: turning off safe_libcxx breaks TSAN 61*8975f5c5SAndroid Build Coastguard Worker enable_safe_libcxx = true 62*8975f5c5SAndroid Build Coastguard Worker} else { 63*8975f5c5SAndroid Build Coastguard Worker enable_safe_libcxx = false 64*8975f5c5SAndroid Build Coastguard Worker} 65