blob: 0d4b7342e8050a708ddfa82bd0d0443c6ae3f12a [file] [log] [blame]
# Copyright 2021 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
config("cxxabi_dependents_config") {
defines = [ "LIBCXXABI_USE_LLVM_UNWINDER" ]
}
config("cxxabi_config") {
cflags = [ "-nostdinc" ]
cflags_cc = [
"-std=c++11",
"-nostdinc++",
"-fPIC",
"-fexceptions",
"-frtti",
"-Werror=return-type",
"-fvisibility-inlines-hidden",
"-fms-compatibility-version=19.00",
"-funwind-tables",
"-Wall",
"-Wextra",
"-Wwrite-strings",
"-Wshorten-64-to-32",
"-Wno-error",
"-Wno-unused-command-line-argument",
]
defines = [
# This macro is used to disable extern template declarations in the libc++
# headers. The intended use case is for clients who wish to use the libc++
# headers without taking a dependency on the libc++ library itself.
"_LIBCPP_DISABLE_EXTERN_TEMPLATE",
# This macro is used to re-enable the `set_unexpected`, `get_unexpected`, and
# `unexpected` functions, which were removed in C++17.
"_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS",
# Let the library headers know they are currently being used to build the
# library.
"_LIBCXXABI_BUILDING_LIBRARY",
]
include_dirs = [ "include" ]
}
static_library("cxxabi") {
sources = [
"src/abort_message.cpp",
"src/abort_message.h",
"src/cxa_aux_runtime.cpp",
"src/cxa_default_handlers.cpp",
"src/cxa_demangle.cpp",
"src/cxa_exception.cpp",
"src/cxa_exception.hpp",
"src/cxa_exception_storage.cpp",
"src/cxa_guard.cpp",
"src/cxa_handlers.cpp",
"src/cxa_handlers.hpp",
"src/cxa_personality.cpp",
"src/cxa_unexpected.cpp",
"src/cxa_vector.cpp",
"src/cxa_virtual.cpp",
"src/demangle/Compiler.h",
"src/demangle/StringView.h",
"src/demangle/Utility.h",
"src/fallback_malloc.cpp",
"src/fallback_malloc.h",
"src/include/atomic_support.h",
"src/include/refstring.h",
"src/private_typeinfo.cpp",
"src/private_typeinfo.h",
"src/stdlib_exception.cpp",
"src/stdlib_new_delete.cpp",
"src/stdlib_stdexcept.cpp",
"src/stdlib_typeinfo.cpp",
# src/cxa_noexception.cpp is omitted because we utilize exception handling
# and this file breaks the build.
# src/cxa_thread_atexit.cpp is omitted becuase it's not needed and it
# introduces __cxa_thread_atexit_impl as an API leak.
]
configs += [ ":cxxabi_config" ]
all_dependent_configs = [ ":cxxabi_dependents_config" ]
deps = [
"//third_party/llvm-project/libunwind:unwind_evergreen",
"//third_party/musl:c",
]
}