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 configs = [ "//build/config/security:executable_config" ] 44} 45 46config("x11") { 47 libs = [ 48 "X11", 49 "X11-xcb", 50 "xcb", 51 "Xcomposite", 52 "Xcursor", 53 "Xdamage", 54 "Xext", 55 "Xfixes", 56 "Xi", 57 "Xrender", 58 "Xtst", 59 ] 60} 61 62# Ensures all exported symbols are added to the dynamic symbol table. This is 63# necessary to expose Chrome's custom operator new() and operator delete() (and 64# other memory-related symbols) to libraries. Otherwise, they might 65# (de)allocate memory on a different heap, which would spell trouble if pointers 66# to heap-allocated memory are passed over shared library boundaries. 67config("export_dynamic") { 68 ldflags = [ "-rdynamic" ] 69} 70