tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

BUILD.gn (954B)


      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 
      5 import("//chromium/build/rust/rust_bindgen.gni")
      6 import("//chromium/build/rust/rust_executable.gni")
      7 import("//chromium/build/rust/rust_static_library.gni")
      8 
      9 source_set("c_lib_headers") {
     10   sources = [ "lib.h" ]
     11 }
     12 
     13 component("c_lib") {
     14   sources = [ "lib.c" ]
     15 
     16   deps = [ ":c_lib_headers" ]
     17 
     18   defines = [ "COMPONENT_IMPLEMENTATION" ]
     19 }
     20 
     21 rust_bindgen("c_lib_bindgen") {
     22   header = "lib.h"
     23   deps = [ ":c_lib_headers" ]
     24   wrap_static_fns = true
     25 }
     26 
     27 rust_static_library("bindgen_static_fns_test_lib") {
     28   allow_unsafe = true
     29   deps = [
     30     ":c_lib",
     31     ":c_lib_bindgen",
     32   ]
     33   sources = [ "src/lib.rs" ]
     34   build_native_rust_unit_tests = true
     35   crate_root = "src/lib.rs"
     36 }
     37 
     38 rust_executable("bindgen_static_fns_test") {
     39   deps = [ ":bindgen_static_fns_test_lib" ]
     40   sources = [ "main.rs" ]
     41   crate_root = "main.rs"
     42 }