OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 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("libcxx_common_config") { |
| 6 cflags = [ |
| 7 # Flags from upstream CMake builds. |
| 8 "-D_DEBUG", |
| 9 "-D__STDC_CONSTANT_MACROS", |
| 10 "-D__STDC_FORMAT_MACROS", |
| 11 "-D__STDC_LIMIT_MACROS", |
| 12 |
| 13 "-fPIC", |
| 14 "-fvisibility-inlines-hidden", |
| 15 |
| 16 "-Werror=return-type", |
| 17 |
| 18 "-Wall", |
| 19 |
| 20 "-Wcast-qual", |
| 21 "-Wcovered-switch-default", |
| 22 "-Wdelete-non-virtual-dtor", |
| 23 "-Wmissing-field-initializers", |
| 24 "-Wnon-virtual-dtor", |
| 25 "-Wwrite-strings", |
| 26 |
| 27 "-Wno-error", |
| 28 "-Wno-long-long", |
| 29 "-Wno-unused-function", |
| 30 |
| 31 "-std=c++11", |
| 32 "-nostdinc++", |
| 33 |
| 34 # Use our sysroot. |
| 35 "--sysroot=fusl_${current_cpu}/sysroot", |
| 36 |
| 37 # Use musl-based libc++ header paths. |
| 38 "-D_LIBCPP_HAS_MUSL_LIBC", |
| 39 ] |
| 40 |
| 41 include_dirs = [ |
| 42 "libcxx/include", |
| 43 "libcxxabi/include", |
| 44 ] |
| 45 } |
| 46 |
| 47 config("libcxx_config") { |
| 48 cflags = [ |
| 49 # Flags from upstream CMake build. |
| 50 "-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER", |
| 51 "-Dcxx_EXPORTS", |
| 52 "-DLIBCXX_BUILDING_LIBCXXABI", |
| 53 |
| 54 "-UNDEBUG", |
| 55 |
| 56 "-Wno-unused-parameter", |
| 57 |
| 58 # Build fix for musl. |
| 59 "-Wno-invalid-constexpr", |
| 60 ] |
| 61 } |
| 62 |
| 63 config("libcxxabi_config") { |
| 64 cflags = [ |
| 65 # Flags from upstream CMake build. |
| 66 "-fstrict-aliasing", |
| 67 |
| 68 "-Wchar-subscripts", |
| 69 "-Wconversion", |
| 70 "-Wmismatched-tags", |
| 71 "-Wmissing-braces", |
| 72 "-Wnewline-eof", |
| 73 "-Wshadow", |
| 74 "-Wshorten-64-to-32", |
| 75 "-Wsign-compare", |
| 76 "-Wsign-conversion", |
| 77 "-Wstrict-aliasing=2", |
| 78 "-Wstrict-overflow=4", |
| 79 "-Wundef", |
| 80 "-Wunused-parameter", |
| 81 "-Wunused-variable", |
| 82 |
| 83 "-pedantic", |
| 84 ] |
| 85 } |
| 86 |
| 87 source_set("libcxxabi_sources") { |
| 88 configs = [] |
| 89 configs += [ |
| 90 ":libcxxabi_config", |
| 91 ":libcxx_common_config", |
| 92 ] |
| 93 |
| 94 deps = [ |
| 95 "//fusl:copy_sysroot", |
| 96 ] |
| 97 |
| 98 sources = [ |
| 99 "libcxxabi/src/abort_message.cpp", |
| 100 "libcxxabi/src/cxa_aux_runtime.cpp", |
| 101 "libcxxabi/src/cxa_default_handlers.cpp", |
| 102 "libcxxabi/src/cxa_demangle.cpp", |
| 103 "libcxxabi/src/cxa_exception.cpp", |
| 104 "libcxxabi/src/cxa_exception_storage.cpp", |
| 105 "libcxxabi/src/cxa_guard.cpp", |
| 106 "libcxxabi/src/cxa_handlers.cpp", |
| 107 "libcxxabi/src/cxa_new_delete.cpp", |
| 108 "libcxxabi/src/cxa_personality.cpp", |
| 109 "libcxxabi/src/cxa_thread_atexit.cpp", |
| 110 "libcxxabi/src/cxa_unexpected.cpp", |
| 111 "libcxxabi/src/cxa_vector.cpp", |
| 112 "libcxxabi/src/cxa_virtual.cpp", |
| 113 "libcxxabi/src/exception.cpp", |
| 114 "libcxxabi/src/private_typeinfo.cpp", |
| 115 "libcxxabi/src/stdexcept.cpp", |
| 116 "libcxxabi/src/typeinfo.cpp", |
| 117 ] |
| 118 } |
| 119 |
| 120 source_set("libcxx_sources") { |
| 121 configs = [] |
| 122 configs += [ |
| 123 ":libcxx_config", |
| 124 ":libcxx_common_config", |
| 125 ] |
| 126 |
| 127 deps = [ |
| 128 "//fusl:copy_sysroot", |
| 129 ] |
| 130 |
| 131 sources = [ |
| 132 "libcxx/src/algorithm.cpp", |
| 133 "libcxx/src/any.cpp", |
| 134 "libcxx/src/bind.cpp", |
| 135 "libcxx/src/chrono.cpp", |
| 136 "libcxx/src/condition_variable.cpp", |
| 137 "libcxx/src/debug.cpp", |
| 138 "libcxx/src/exception.cpp", |
| 139 "libcxx/src/future.cpp", |
| 140 "libcxx/src/hash.cpp", |
| 141 "libcxx/src/ios.cpp", |
| 142 "libcxx/src/iostream.cpp", |
| 143 "libcxx/src/locale.cpp", |
| 144 "libcxx/src/memory.cpp", |
| 145 "libcxx/src/mutex.cpp", |
| 146 "libcxx/src/new.cpp", |
| 147 "libcxx/src/optional.cpp", |
| 148 "libcxx/src/random.cpp", |
| 149 "libcxx/src/regex.cpp", |
| 150 "libcxx/src/shared_mutex.cpp", |
| 151 "libcxx/src/stdexcept.cpp", |
| 152 "libcxx/src/string.cpp", |
| 153 "libcxx/src/strstream.cpp", |
| 154 "libcxx/src/system_error.cpp", |
| 155 "libcxx/src/thread.cpp", |
| 156 "libcxx/src/typeinfo.cpp", |
| 157 "libcxx/src/utility.cpp", |
| 158 "libcxx/src/valarray.cpp", |
| 159 ] |
| 160 } |
| 161 |
| 162 static_library("libcxx") { |
| 163 complete_static_lib = true |
| 164 |
| 165 deps = [ |
| 166 ":libcxx_sources", |
| 167 ":libcxxabi_sources", |
| 168 ] |
| 169 } |
OLD | NEW |