1# Copyright 2013 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 5import("//build/config/c++/c++.gni") 6import("//build/config/chromeos/ui_mode.gni") 7import("//build/config/linux/pkg_config.gni") 8import("//build/config/ui.gni") 9 10group("linux") { 11 visibility = [ "//:optimize_gn_gen" ] 12} 13 14# This is included by reference in the //build/config/compiler config that 15# is applied to all targets. It is here to separate out the logic that is 16# Linux-only. This is not applied to Android, but is applied to ChromeOS. 17config("compiler") { 18 if (current_cpu == "arm64") { 19 import("//build/config/arm.gni") 20 cflags = [] 21 asmflags = [] 22 if (arm_control_flow_integrity == "standard") { 23 cflags += [ "-mbranch-protection=standard" ] 24 asmflags += [ "-mbranch-protection=standard" ] 25 } else if (arm_control_flow_integrity == "pac") { 26 cflags += [ "-mbranch-protection=pac-ret" ] 27 asmflags += [ "-mbranch-protection=pac-ret" ] 28 } 29 } 30} 31 32# This is included by reference in the //build/config/compiler:runtime_library 33# config that is applied to all targets. It is here to separate out the logic 34# that is Linux-only. Please see that target for advice on what should go in 35# :runtime_library vs. :compiler. 36config("runtime_library") { 37 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like 38 # OS_LINUX and the like. 39 if (is_chromeos) { 40 defines = [ "OS_CHROMEOS" ] 41 } 42 43 if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") && 44 (!use_custom_libcxx || current_cpu == "mipsel")) { 45 libs = [ "atomic" ] 46 } 47} 48 49config("libcap") { 50 libs = [ "cap" ] 51} 52 53config("libresolv") { 54 libs = [ "resolv" ] 55} 56 57if (use_glib) { 58 pkg_config("glib") { 59 packages = [ 60 "glib-2.0", 61 "gmodule-2.0", 62 "gobject-2.0", 63 "gthread-2.0", 64 ] 65 defines = [ 66 "GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56", 67 "GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56", 68 ] 69 } 70} 71