| # Copyright 2026 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # Support libraries for C++ DSO components. See //src/sys/runners/dso/README.md | |
| # for more information. | |
| # | |
| # DSO runner supports two kinds of components: "sync" and "async". Sync | |
| # components receive a dedicated thread -- their dso_main() is very similar to | |
| # standard main(). Async components may share a thread and run on a Fuchsia | |
| # Driver Framework dispatcher (`fdf_dispatcher_t*`). DSO components that are | |
| # written in C++ should depend on the corresponding library depending on if they | |
| # are sync or async. Most users should use the convenience "fuchsia_cc_dso" | |
| # wrapper in `fuchsia_dso.gni` to do this for them. | |
| load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| fx_cc_library( | |
| name = "sync", | |
| srcs = ["sync.cc"], | |
| hdrs = ["sync.h"], | |
| implementation_deps = ["//zircon/system/public"], | |
| # fuchsia_cc_dso() in //src/lib/dso/fuchsia_dso.gni expands in callers' GN packages. | |
| visibility = [ | |
| "//examples/components/dso:__pkg__", | |
| "//src/lib/dso:__pkg__", | |
| "//src/sys/runners/dso:__subpackages__", | |
| "//src/ui/bin/scene_manager:__pkg__", | |
| "//src/ui/scenic/bin:__pkg__", | |
| ], | |
| alwayslink = True, | |
| ) |