Index: third_party/libc++/BUILD.gn |
diff --git a/third_party/libc++/BUILD.gn b/third_party/libc++/BUILD.gn |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e225b7f2347c1f88a5a52c48dd5769e952356ee9 |
--- /dev/null |
+++ b/third_party/libc++/BUILD.gn |
@@ -0,0 +1,101 @@ |
+# Copyright 2015 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+config("config") { |
+ include_dirs = [ |
+ "trunk/include", |
+ "../libc++abi/trunk/include", |
+ ] |
+ cflags = [ |
+ "-fPIC", |
+ "-fstrict-aliasing", |
+ "-nostdinc++", |
+ "-pthread", |
+ "-std=c++11", |
+ ] |
+} |
+ |
+shared_library("libc++") { |
+ sources = [ |
+ "trunk/src/algorithm.cpp", |
+ "trunk/src/bind.cpp", |
+ "trunk/src/chrono.cpp", |
+ "trunk/src/condition_variable.cpp", |
+ "trunk/src/debug.cpp", |
+ "trunk/src/exception.cpp", |
+ "trunk/src/future.cpp", |
+ "trunk/src/hash.cpp", |
+ "trunk/src/ios.cpp", |
+ "trunk/src/iostream.cpp", |
+ "trunk/src/locale.cpp", |
+ "trunk/src/memory.cpp", |
+ "trunk/src/mutex.cpp", |
+ "trunk/src/new.cpp", |
+ "trunk/src/optional.cpp", |
+ "trunk/src/random.cpp", |
+ "trunk/src/regex.cpp", |
+ "trunk/src/shared_mutex.cpp", |
+ "trunk/src/stdexcept.cpp", |
+ "trunk/src/string.cpp", |
+ "trunk/src/strstream.cpp", |
+ "trunk/src/system_error.cpp", |
+ "trunk/src/thread.cpp", |
+ "trunk/src/typeinfo.cpp", |
+ "trunk/src/utility.cpp", |
+ "trunk/src/valarray.cpp", |
+ ] |
+ configs -= [ |
+ "//build/config/compiler:chromium_code", |
+ "//build/config/compiler:no_rtti", |
+ "//build/config/gcc:no_exceptions", |
+ "//build/config/gcc:symbol_visibility_hidden", |
+ ] |
+ configs += [ |
+ ":config", |
+ "//build/config/compiler:no_chromium_code", |
+ "//build/config/compiler:rtti", |
+ "//build/config/sanitizers:sanitizer_options_link_helper", |
+ ] |
+ |
+ ldflags = [ "-nodefaultlibs" ] |
+ |
+ # TODO(GYP): Remove "-pthread" from ldflags. |
+ # -nodefaultlibs turns -pthread into a no-op, causing an unused argument |
+ # warning. Explicitly link with -lpthread instead. |
+ |
+ libs = [ |
+ "c", |
+ "gcc_s", |
+ "m", |
+ "pthread", |
+ "rt", |
+ ] |
+ |
+ # libc++abi is linked statically into libc++.so. This allows us to get both |
+ # libc++ and libc++abi by passing '-stdlib=libc++'. If libc++abi was a |
+ # separate DSO, we'd have to link against it explicitly. |
+ deps = [ |
+ "//buildtools/third_party/libc++abi", |
+ ] |
+} |
+ |
+group("libcxx_proxy") { |
+ deps = [ |
+ ":libc++", |
+ ] |
+ public_configs = [ ":link_helper" ] |
+} |
+ |
+config("link_helper") { |
+ ldflags = [ |
+ "-stdlib=libc++", |
+ |
+ # Normally the generator takes care of RPATH. Our case is special because |
+ # the generator is unaware of the libc++.so dependency. Note that setting |
+ # RPATH here is a potential security issue. See the following for another |
+ # example of this issue: https://code.google.com/p/gyp/issues/detail?id=315 |
+ "-Wl,-R,\$ORIGIN/", |
+ ] |
+ lib_dirs = [ root_build_dir ] |
+} |