mixed_static_library.gni 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # Copyright 2022 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. import("//build/config/rust.gni")
  5. import("//build/rust/mixed_target.gni")
  6. # Defines a static_library containing both Rust and C++ code. See
  7. # mixed_target.gni for documentation.
  8. #
  9. # Note that the rustc concept of a static library (aka staticlib) differs from
  10. # this GN target type. A staticlib includes all dependencies linked into the
  11. # library. Whereas this target is a static library containing only the sources
  12. # listed for it, not its dependencies, for both the C++ and Rust parts of the
  13. # GN target.
  14. template("mixed_static_library") {
  15. mixed_target(target_name) {
  16. target_type = "static_library"
  17. forward_variables_from(invoker,
  18. "*",
  19. TESTONLY_AND_VISIBILITY + [ "rs_visibility" ])
  20. forward_variables_from(invoker,
  21. TESTONLY_AND_VISIBILITY + [ "rs_visibility" ])
  22. }
  23. }
  24. set_defaults("mixed_static_library") {
  25. configs = default_compiler_configs
  26. }