rust_shared_library.gni 871 B

1234567891011121314151617181920212223242526
  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/rust/rust_target.gni")
  5. # Defines a shared_library containing just Rust code. Has the same variables
  6. # available as a rust_static_library. See rust_static_library.gni for
  7. # documentation.
  8. template("rust_shared_library") {
  9. exclude_forwards = TESTONLY_AND_VISIBILITY + [ "configs" ]
  10. rust_target(target_name) {
  11. forward_variables_from(invoker, "*", exclude_forwards)
  12. forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
  13. if (defined(invoker.configs)) {
  14. library_configs = []
  15. library_configs = invoker.configs
  16. }
  17. target_type = "shared_library"
  18. crate_type = "cdylib"
  19. }
  20. }
  21. set_defaults("rust_shared_library") {
  22. configs = default_shared_library_configs
  23. }