Francois Rousseau c8dc08b719 [fuchsia] clean up third_party/fuchsia/BUILD.gn
Change-Id: I5c5f03ea5882592008d11e2819962e8781954ca2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1555833
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-08 16:13:29 +00:00

185 lines
6.2 KiB
Plaintext

# Copyright 2018 The Crashpad 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.
import("../../build/crashpad_buildconfig.gni")
if (crashpad_is_in_fuchsia) {
group("fuchsia") {
public_deps = [
"//zircon/public/fidl/fuchsia-sysinfo:fuchsia-sysinfo_c",
"//zircon/public/lib/fdio",
"//zircon/public/lib/zx",
]
}
} else if (crashpad_is_in_chromium) {
group("fuchsia") {
public_deps = [
"//third_party/fuchsia-sdk/sdk:fdio",
"//third_party/fuchsia-sdk/sdk:sysinfo",
"//third_party/fuchsia-sdk/sdk:zx",
]
}
} else {
sdk_path = "sdk/$host_os-amd64"
sdk_pkg_path = "$sdk_path/pkg"
sdk_fidl_sources_path = "$sdk_path/fidl"
config("zx_config") {
visibility = [ ":fuchsia" ]
include_dirs = [ "$sdk_pkg_path/zx/include" ]
}
fidl_root_gen_dir = "$root_gen_dir/fidl/include"
config("fidl_config") {
visibility = [ ":fuchsia" ]
include_dirs = [
fidl_root_gen_dir,
"$sdk_pkg_path/fidl/include",
"$sdk_pkg_path/fidl_base/include",
]
}
fidl_sources = [
{
fidl = "$sdk_fidl_sources_path/fuchsia.sysinfo/sysinfo.fidl"
header_stem = "fuchsia/sysinfo"
library_name = "fuchsia.sysinfo"
},
]
fidl_gen_sources = []
foreach(fidl_source, fidl_sources) {
fidl_stem = "$target_gen_dir/fidl/${fidl_source.library_name}"
c_stem = "$fidl_root_gen_dir/${fidl_source.header_stem}/c"
c_header = "$c_stem/fidl.h"
c_client = "$c_stem/client.cc"
coding_tables = "$fidl_stem/tables.cc"
fidl_gen_sources += [
c_client,
coding_tables,
]
# Compiles the .fidl file and generates the C bindings.
action("fidlc_${fidl_source.library_name}") {
visibility = [ ":*" ]
script = "runner.py"
args = [
rebase_path("$sdk_path/tools/fidlc", root_build_dir),
"--c-header",
rebase_path(c_header, root_build_dir),
"--c-client",
rebase_path(c_client, root_build_dir),
"--tables",
rebase_path(coding_tables, root_build_dir),
"--name",
fidl_source.library_name,
"--files",
rebase_path(fidl_source.fidl, root_build_dir),
]
inputs = [
"$sdk_path/tools/fidlc",
fidl_source.fidl,
]
outputs = [
c_client,
c_header,
coding_tables,
]
}
}
static_library("fuchsia") {
sources =
[
# This is the zx library.
"$sdk_pkg_path/zx/channel.cpp",
"$sdk_pkg_path/zx/event.cpp",
"$sdk_pkg_path/zx/eventpair.cpp",
"$sdk_pkg_path/zx/fifo.cpp",
"$sdk_pkg_path/zx/guest.cpp",
"$sdk_pkg_path/zx/include/lib/zx/bti.h",
"$sdk_pkg_path/zx/include/lib/zx/channel.h",
"$sdk_pkg_path/zx/include/lib/zx/event.h",
"$sdk_pkg_path/zx/include/lib/zx/eventpair.h",
"$sdk_pkg_path/zx/include/lib/zx/fifo.h",
"$sdk_pkg_path/zx/include/lib/zx/guest.h",
"$sdk_pkg_path/zx/include/lib/zx/handle.h",
"$sdk_pkg_path/zx/include/lib/zx/interrupt.h",
"$sdk_pkg_path/zx/include/lib/zx/job.h",
"$sdk_pkg_path/zx/include/lib/zx/object.h",
"$sdk_pkg_path/zx/include/lib/zx/object_traits.h",
"$sdk_pkg_path/zx/include/lib/zx/pmt.h",
"$sdk_pkg_path/zx/include/lib/zx/port.h",
"$sdk_pkg_path/zx/include/lib/zx/process.h",
"$sdk_pkg_path/zx/include/lib/zx/resource.h",
"$sdk_pkg_path/zx/include/lib/zx/socket.h",
"$sdk_pkg_path/zx/include/lib/zx/task.h",
"$sdk_pkg_path/zx/include/lib/zx/thread.h",
"$sdk_pkg_path/zx/include/lib/zx/time.h",
"$sdk_pkg_path/zx/include/lib/zx/timer.h",
"$sdk_pkg_path/zx/include/lib/zx/vmar.h",
"$sdk_pkg_path/zx/include/lib/zx/vmo.h",
"$sdk_pkg_path/zx/interrupt.cpp",
"$sdk_pkg_path/zx/job.cpp",
"$sdk_pkg_path/zx/port.cpp",
"$sdk_pkg_path/zx/process.cpp",
"$sdk_pkg_path/zx/resource.cpp",
"$sdk_pkg_path/zx/socket.cpp",
"$sdk_pkg_path/zx/thread.cpp",
"$sdk_pkg_path/zx/timer.cpp",
"$sdk_pkg_path/zx/vmar.cpp",
"$sdk_pkg_path/zx/vmo.cpp",
# This is the fidl_base library.
"$sdk_pkg_path/fidl_base/builder.cpp",
"$sdk_pkg_path/fidl_base/decoding.cpp",
"$sdk_pkg_path/fidl_base/encoding.cpp",
"$sdk_pkg_path/fidl_base/envelope_frames.h",
"$sdk_pkg_path/fidl_base/formatting.cpp",
"$sdk_pkg_path/fidl_base/include/lib/fidl/coding.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/builder.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/message.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/message_buffer.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/message_builder.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/message_part.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/string_view.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/cpp/vector_view.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/internal.h",
"$sdk_pkg_path/fidl_base/include/lib/fidl/internal_callable_traits.h",
"$sdk_pkg_path/fidl_base/linearizing.cpp",
"$sdk_pkg_path/fidl_base/message.cpp",
"$sdk_pkg_path/fidl_base/message_buffer.cpp",
"$sdk_pkg_path/fidl_base/message_builder.cpp",
"$sdk_pkg_path/fidl_base/validating.cpp",
"$sdk_pkg_path/fidl_base/visitor.h",
"$sdk_pkg_path/fidl_base/walker.cpp",
"$sdk_pkg_path/fidl_base/walker.h",
] + fidl_gen_sources
deps = [
":fidlc_fuchsia.sysinfo",
]
public_configs = [
":fidl_config",
":zx_config",
]
}
}