Index: third_party/libcxx/BUILD.gn |
diff --git a/third_party/libcxx/BUILD.gn b/third_party/libcxx/BUILD.gn |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8df93d3f36db645ad1e5cadd235bd5fc897f01c9 |
--- /dev/null |
+++ b/third_party/libcxx/BUILD.gn |
@@ -0,0 +1,188 @@ |
+# Copyright 2016 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("libcxx_config") { |
+ cflags = [ |
+ # Flags from upstream CMake build |
+ "-D_DEBUG", |
+ "-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER", |
+ "-D__STDC_CONSTANT_MACROS", |
+ "-D__STDC_FORMAT_MACROS", |
+ "-D__STDC_LIMIT_MACROS", |
+ "-Dcxx_EXPORTS", |
+ "-DLIBCXX_BUILDING_LIBCXXABI", |
+ |
+ "-UNDEBUG", |
+ |
+ "-fPIC", |
+ "-fvisibility-inlines-hidden", |
+ |
+ "-Wall", |
+ "-Werror=return-type", |
+ |
+ "-Wcast-qual", |
+ "-Wcovered-switch-default", |
+ "-Wdelete-non-virtual-dtor", |
+ "-Wmissing-field-initializers", |
+ "-Wno-error", |
+ "-Wno-long-long", |
+ "-Wno-long-long", |
+ "-Wno-unused-parameter", |
+ "-Wno-unused-parameter", |
+ "-Wnon-virtual-dtor", |
+ "-Wwrite-strings", |
+ |
+ "-std=c++11", |
+ "-nostdinc++", |
+ |
+ # Use musl-based libc |
+ "-D_LIBCPP_HAS_MUSL_LIBC", |
viettrungluu
2016/01/15 23:41:50
Is this only used in the .cpp files?
(Ditto for s
Petr Hosek
2016/01/16 02:55:02
The problem with this approach is that everyone wh
|
+ ] |
+} |
+ |
+static_library("libcxx") { |
+ cflags = [] |
+ |
+ configs = [] |
+ configs += [ ":libcxx_config" ] |
+ |
+ include_dirs = [ |
+ "libcxx/include", |
+ "libcxxabi/include", |
+ ] |
+ |
+ cflags += [ |
viettrungluu
2016/01/15 23:41:50
Note: A simple "cflags = [ ... ]" here works and i
|
+ "--sysroot", |
viettrungluu
2016/01/15 23:41:50
Is this really the right way to do this?
Should w
|
+ "obj/fusl/sysroot", |
+ ] |
+ |
+ complete_static_lib = true |
+ |
+ deps = [ |
+ "//fusl:sysroot", |
+ ] |
+ |
+ sources = [ |
+ "libcxx/src/algorithm.cpp", |
+ "libcxx/src/any.cpp", |
+ "libcxx/src/bind.cpp", |
+ "libcxx/src/chrono.cpp", |
+ "libcxx/src/condition_variable.cpp", |
+ "libcxx/src/debug.cpp", |
+ "libcxx/src/exception.cpp", |
+ "libcxx/src/future.cpp", |
+ "libcxx/src/hash.cpp", |
+ "libcxx/src/ios.cpp", |
+ "libcxx/src/iostream.cpp", |
+ "libcxx/src/locale.cpp", |
+ "libcxx/src/memory.cpp", |
+ "libcxx/src/mutex.cpp", |
+ "libcxx/src/new.cpp", |
+ "libcxx/src/optional.cpp", |
+ "libcxx/src/random.cpp", |
+ "libcxx/src/regex.cpp", |
+ "libcxx/src/shared_mutex.cpp", |
+ "libcxx/src/stdexcept.cpp", |
+ "libcxx/src/string.cpp", |
+ "libcxx/src/strstream.cpp", |
+ "libcxx/src/system_error.cpp", |
+ "libcxx/src/thread.cpp", |
+ "libcxx/src/typeinfo.cpp", |
+ "libcxx/src/utility.cpp", |
+ "libcxx/src/valarray.cpp", |
+ ] |
+} |
+ |
+config("libcxxabi_config") { |
viettrungluu
2016/01/15 23:41:50
I wonder if we should share more of this with libc
|
+ cflags = [ |
+ # Flags from upstream CMake build |
+ "-D_DEBUG", |
+ "-D__STDC_CONSTANT_MACROS", |
+ "-D__STDC_FORMAT_MACROS", |
+ "-D__STDC_LIMIT_MACROS", |
+ |
+ "-fPIC", |
+ "-fstrict-aliasing", |
+ "-fvisibility-inlines-hidden", |
+ |
+ "-Wall", |
+ "-Wcast-qual", |
+ "-Wchar-subscripts", |
+ "-Wconversion", |
+ "-Wcovered-switch-default", |
+ "-Wdelete-non-virtual-dtor", |
+ "-Werror=return-type", |
+ "-Wmismatched-tags", |
+ "-Wmissing-braces", |
+ "-Wmissing-field-initializers", |
+ "-Wnewline-eof", |
+ "-Wno-error", |
+ "-Wno-long-long", |
+ "-Wno-unused-function", |
+ "-Wno-unused-parameter", |
+ "-Wnon-virtual-dtor", |
+ "-Wshadow", |
+ "-Wshorten-64-to-32", |
+ "-Wsign-compare", |
+ "-Wsign-conversion", |
+ "-Wstrict-aliasing=2", |
+ "-Wstrict-overflow=4", |
+ "-Wundef", |
+ "-Wunused-parameter", |
+ "-Wunused-variable", |
+ "-Wwrite-strings", |
+ "-Wwrite-strings", |
+ |
+ "-std=c++11", |
+ "-pedantic", |
+ "-nostdinc++", |
+ |
+ # Use musl-based libc |
+ "-D_LIBCPP_HAS_MUSL_LIBC", |
+ ] |
+} |
+ |
+static_library("libcxxabi") { |
+ cflags = [] |
+ |
+ configs = [] |
+ configs += [ ":libcxxabi_config" ] |
+ |
+ include_dirs = [ |
+ "libcxx/include", |
+ "libcxxabi/include", |
+ ] |
+ |
+ cflags += [ |
+ "--sysroot", |
+ "obj/fusl/sysroot", |
+ ] |
+ |
+ complete_static_lib = true |
+ |
+ deps = [ |
+ "//fusl:sysroot", |
+ ] |
+ |
+ sources = [ |
+ "libcxxabi/src/abort_message.cpp", |
+ "libcxxabi/src/cxa_aux_runtime.cpp", |
+ "libcxxabi/src/cxa_default_handlers.cpp", |
+ "libcxxabi/src/cxa_demangle.cpp", |
+ "libcxxabi/src/cxa_exception.cpp", |
+ "libcxxabi/src/cxa_exception_storage.cpp", |
+ "libcxxabi/src/cxa_guard.cpp", |
+ "libcxxabi/src/cxa_handlers.cpp", |
+ "libcxxabi/src/cxa_new_delete.cpp", |
+ "libcxxabi/src/cxa_personality.cpp", |
+ "libcxxabi/src/cxa_thread_atexit.cpp", |
+ "libcxxabi/src/cxa_unexpected.cpp", |
+ "libcxxabi/src/cxa_vector.cpp", |
+ "libcxxabi/src/cxa_virtual.cpp", |
+ "libcxxabi/src/exception.cpp", |
+ "libcxxabi/src/private_typeinfo.cpp", |
+ "libcxxabi/src/stdexcept.cpp", |
+ "libcxxabi/src/typeinfo.cpp", |
+ ] |
+} |