OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 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 |
| 5 config("config") { |
| 6 include_dirs = [ |
| 7 "trunk/include", |
| 8 "../libc++abi/trunk/include", |
| 9 ] |
| 10 cflags = [ |
| 11 "-fPIC", |
| 12 "-fstrict-aliasing", |
| 13 "-nostdinc++", |
| 14 "-pthread", |
| 15 "-std=c++11", |
| 16 ] |
| 17 } |
| 18 |
| 19 shared_library("libc++") { |
| 20 sources = [ |
| 21 "trunk/src/algorithm.cpp", |
| 22 "trunk/src/bind.cpp", |
| 23 "trunk/src/chrono.cpp", |
| 24 "trunk/src/condition_variable.cpp", |
| 25 "trunk/src/debug.cpp", |
| 26 "trunk/src/exception.cpp", |
| 27 "trunk/src/future.cpp", |
| 28 "trunk/src/hash.cpp", |
| 29 "trunk/src/ios.cpp", |
| 30 "trunk/src/iostream.cpp", |
| 31 "trunk/src/locale.cpp", |
| 32 "trunk/src/memory.cpp", |
| 33 "trunk/src/mutex.cpp", |
| 34 "trunk/src/new.cpp", |
| 35 "trunk/src/optional.cpp", |
| 36 "trunk/src/random.cpp", |
| 37 "trunk/src/regex.cpp", |
| 38 "trunk/src/shared_mutex.cpp", |
| 39 "trunk/src/stdexcept.cpp", |
| 40 "trunk/src/string.cpp", |
| 41 "trunk/src/strstream.cpp", |
| 42 "trunk/src/system_error.cpp", |
| 43 "trunk/src/thread.cpp", |
| 44 "trunk/src/typeinfo.cpp", |
| 45 "trunk/src/utility.cpp", |
| 46 "trunk/src/valarray.cpp", |
| 47 ] |
| 48 configs -= [ |
| 49 "//build/config/compiler:chromium_code", |
| 50 "//build/config/compiler:no_rtti", |
| 51 "//build/config/gcc:no_exceptions", |
| 52 "//build/config/gcc:symbol_visibility_hidden", |
| 53 ] |
| 54 configs += [ |
| 55 ":config", |
| 56 "//build/config/compiler:no_chromium_code", |
| 57 "//build/config/compiler:rtti", |
| 58 "//build/config/sanitizers:sanitizer_options_link_helper", |
| 59 ] |
| 60 |
| 61 ldflags = [ "-nodefaultlibs" ] |
| 62 |
| 63 # TODO(GYP): Remove "-pthread" from ldflags. |
| 64 # -nodefaultlibs turns -pthread into a no-op, causing an unused argument |
| 65 # warning. Explicitly link with -lpthread instead. |
| 66 |
| 67 libs = [ |
| 68 "c", |
| 69 "gcc_s", |
| 70 "m", |
| 71 "pthread", |
| 72 "rt", |
| 73 ] |
| 74 |
| 75 # libc++abi is linked statically into libc++.so. This allows us to get both |
| 76 # libc++ and libc++abi by passing '-stdlib=libc++'. If libc++abi was a |
| 77 # separate DSO, we'd have to link against it explicitly. |
| 78 deps = [ |
| 79 "//buildtools/third_party/libc++abi", |
| 80 ] |
| 81 } |
| 82 |
| 83 group("libcxx_proxy") { |
| 84 deps = [ |
| 85 ":libc++", |
| 86 ] |
| 87 public_configs = [ ":link_helper" ] |
| 88 } |
| 89 |
| 90 config("link_helper") { |
| 91 ldflags = [ |
| 92 "-stdlib=libc++", |
| 93 |
| 94 # Normally the generator takes care of RPATH. Our case is special because |
| 95 # the generator is unaware of the libc++.so dependency. Note that setting |
| 96 # RPATH here is a potential security issue. See the following for another |
| 97 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=315 |
| 98 "-Wl,-R,\$ORIGIN/", |
| 99 ] |
| 100 lib_dirs = [ root_build_dir ] |
| 101 } |
OLD | NEW |