1# Copyright (c) 2013 The Chromium Authors. All rights reserved. 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") 6 7group("linux") { 8 visibility = [ "//:optimize_gn_gen" ] 9} 10 11# This is included by reference in the //build/config/compiler config that 12# is applied to all targets. It is here to separate out the logic that is 13# Linux-only. 14config("compiler") { 15} 16 17# This is included by reference in the //build/config/compiler:runtime_library 18# config that is applied to all targets. It is here to separate out the logic 19# that is Linux-only. Please see that target for advice on what should go in 20# :runtime_library vs. :compiler. 21config("runtime_library") { 22 # Set here because OS_CHROMEOS cannot be autodetected in build_config.h like OS_LINUX and the like. 23 if (is_chromeos) { 24 defines = [ "OS_CHROMEOS" ] 25 } 26 libs = [] 27 if ((!is_chromeos || default_toolchain != "//build/toolchain/cros:target") && 28 !use_custom_libcxx) { 29 libs += [ "atomic" ] 30 } 31 32 # double framework, use prebuilt libc++. 33 if (is_double_framework) { 34 if (current_cpu == "x86") { 35 libs += [ "${asdk_libs_dir}/ndk/libcxx/linux_x86/libc++.so" ] 36 } else { 37 libs += [ "${asdk_libs_dir}/ndk/libcxx/linux_x86_64/libc++.so" ] 38 } 39 } 40} 41 42config("executable_config") { 43 cflags = [ "-fPIE" ] 44 asmflags = [ "-fPIE" ] 45 ldflags = [ "-pie" ] 46} 47 48config("x11") { 49 libs = [ 50 "X11", 51 "X11-xcb", 52 "xcb", 53 "Xcomposite", 54 "Xcursor", 55 "Xdamage", 56 "Xext", 57 "Xfixes", 58 "Xi", 59 "Xrender", 60 "Xtst", 61 ] 62} 63 64config("xcomposite") { 65 libs = [ "Xcomposite" ] 66} 67 68config("xext") { 69 libs = [ "Xext" ] 70} 71 72config("xrandr") { 73 libs = [ "Xrandr" ] 74} 75 76config("xscrnsaver") { 77 libs = [ "Xss" ] 78} 79 80config("xfixes") { 81 libs = [ "Xfixes" ] 82} 83 84config("libcap") { 85 libs = [ "cap" ] 86} 87 88config("xi") { 89 libs = [ "Xi" ] 90} 91 92config("xtst") { 93 libs = [ "Xtst" ] 94} 95 96config("libresolv") { 97 libs = [ "resolv" ] 98} 99 100# Ensures all exported symbols are added to the dynamic symbol table. This is 101# necessary to expose Chrome's custom operator new() and operator delete() (and 102# other memory-related symbols) to libraries. Otherwise, they might 103# (de)allocate memory on a different heap, which would spell trouble if pointers 104# to heap-allocated memory are passed over shared library boundaries. 105config("export_dynamic") { 106 ldflags = [ "-rdynamic" ] 107} 108