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 64# Ensures all exported symbols are added to the dynamic symbol table. This is 65# necessary to expose Chrome's custom operator new() and operator delete() (and 66# other memory-related symbols) to libraries. Otherwise, they might 67# (de)allocate memory on a different heap, which would spell trouble if pointers 68# to heap-allocated memory are passed over shared library boundaries. 69config("export_dynamic") { 70 ldflags = [ "-rdynamic" ] 71} 72