chromium/third_party/blink/common/rust_crash/BUILD.gn

# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file provides some code which intentionally crashes in Rust.

import("//build/config/compiler/compiler.gni")
import("//build/config/rust.gni")
import("//build/rust/rust_static_library.gni")

group("rust_crash") {
  public_deps = [ ":rs" ]
  deps = [ ":cpp" ]
}

source_set("cpp") {
  sources = [
    "rust_crash.cc",
    "rust_crash.h",
  ]
  deps = [ ":rs" ]
}

rust_static_library("rs") {
  sources = [ "src/lib.rs" ]
  cxx_bindings = [ "src/lib.rs" ]
  allow_unsafe = true
  if (is_asan) {
    features = [ "rust_crash_asan_enabled" ]
  }
}