xref: /aosp_15_r20/external/angle/build/rust/tests/bindgen_cpp_test/BUILD.gn (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Copyright 2024 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/rust/rust_bindgen.gni")
6import("//build/rust/rust_executable.gni")
7
8source_set("cpp_lib") {
9  sources = [
10    "cpp.cc",
11    "cpp.h",
12  ]
13}
14
15rust_bindgen("cpp_lib_bindgen") {
16  deps = [ ":cpp_lib" ]
17  header = "cpp.h"
18  cpp = true
19}
20
21rust_executable("bindgen_cpp_test") {
22  deps = [
23    ":cpp_lib",
24    ":cpp_lib_bindgen",
25  ]
26  sources = [ "main.rs" ]
27  crate_root = "main.rs"
28
29  allow_unsafe = true  # Needed for FFI.
30}
31