blob: 9f9f33e9bc46ae2beaba1199be2700f5721e4d31 [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.
static_library("unwind_starboard") {
sources = [
"src/AddressSpace.hpp",
"src/assembly.h",
"src/CompactUnwinder.hpp",
"src/config.h",
"src/dwarf2.h",
"src/DwarfInstructions.hpp",
"src/DwarfParser.hpp",
"src/EHHeaderParser.hpp",
"src/libunwind.cpp",
"src/libunwind_ext.h",
"src/Registers.hpp",
"src/RWMutex.hpp",
"src/UnwindCursor.hpp",
"src/Unwind-EHABI.cpp",
"src/Unwind-EHABI.h",
"src/UnwindLevel1.c",
"src/UnwindLevel1-gcc-ext.c",
"src/UnwindRegistersRestore.S",
"src/UnwindRegistersSave.S",
"src/Unwind-sjlj.c",
]
if (is_apple) {
sources += [ "src/Unwind_AppleExtras.cpp" ]
}
public_deps = [
"//starboard/common",
"//starboard/elf_loader:evergreen_info",
]
configs += [ ":internal_config" ]
all_dependent_configs = [ ":dependents_config" ]
}
config("dependents_config") {
include_dirs = [ "include" ]
defines = [
# Ensure that __external_threading is used for threading support.
"_LIBCPP_HAS_THREAD_API_EXTERNAL",
"LLVM_PATH=" + rebase_path("//third_party/llvm-project/llvm/", root_build_dir),
]
}
config("internal_config") {
configs = [
":dependents_config",
"//starboard/build/config:starboard_implementation",
]
cflags = [ "-Wno-unused-command-line-argument" ]
cflags_cc = [
"-std=c++11",
"-fPIC",
"-Werror=return-type",
"-fvisibility-inlines-hidden",
"-funwind-tables",
"-W",
"-Wall",
"-Wextra",
"-Wwrite-strings",
"-Wno-error",
"-Wno-unused-parameter",
]
defines = [
# Build libunwind with concurrency built upon Starboard mutexes and
# condition variables.
"_LIBUNWIND_HAS_STARBOARD_THREADS",
]
}