Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  BUILD.gn   Sprache: unbekannt

 
Spracherkennung für: .gn vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

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

import("//chromium/build/config/rust.gni")

if (toolchain_has_rust) {
  config("edition_2024") {
    rustflags = [ "--edition=2024" ]
  }

  config("edition_2021") {
    rustflags = [ "--edition=2021" ]
  }

  config("edition_2018") {
    rustflags = [ "--edition=2018" ]
  }

  config("edition_2015") {
    rustflags = [ "--edition=2015" ]
  }

  if (enable_rust_cxx) {
    # The required dependencies for cxx-generated bindings, that must be included
    # on the C++ side.
    static_library("cxx_cppdeps") {
      sources = [
        "//third_party/rust/chromium_crates_io/vendor/cxx-v1/include/cxx.h",
        "//third_party/rust/chromium_crates_io/vendor/cxx-v1/src/cxx.cc",

        # Our version-independent forwarding header, which we patch cxx.cc to
        # use since we want it to use an absolute path for its include.
        "//third_party/rust/cxx/v1/cxx.h",
      ]

      defines = [ "RUST_CXX_NO_EXCEPTIONS" ]

      # We cannot depend on base/base_export.h because base depends on us.
      if (is_component_build) {
        if (is_win) {
          defines += [ "CXX_RS_EXPORT=__declspec(dllexport)" ]
        } else {
          defines +=
              [ "CXX_RS_EXPORT=__attribute__((visibility(\"default\")))" ]
        }
      } else {
        defines += [ "CXX_RS_EXPORT=" ]
      }

      deps = [
        # Depending on the C++ bindings side of cxx then requires also depending
        # on the Rust bindings, since one calls the other. And the Rust bindings
        # require the Rust standard library.
        ":cxx_rustdeps",
      ]
    }

    group("cxx_rustdeps") {
      # The required dependencies for cxx-generated bindings, that must be
      # included on the Rust side.
      public_deps = [ "//third_party/rust/cxx/v1:lib" ]
    }
  }
}

# Enables code behind #[cfg(test)]. This should only be used for targets where
# testonly=true.
config("test") {
  rustflags = [
    "--cfg",
    "test",
  ]
}

# TODO(crbug.com/gn/104): GN rust_proc_macro targets are missing this
# command line flag, for the proc_macro crate which is provided by rustc for
# compiling proc-macros.
config("proc_macro_extern") {
  rustflags = [
    "--extern",
    "proc_macro",
  ]
}

# Forbids unsafe code in crates with this config.
config("forbid_unsafe") {
  rustflags = [ "-Funsafe_code" ]
}

config("panic_immediate_abort") {
  visibility = [ "//chromium/build/rust/std/rules:*" ]
  if (is_official_build) {
    rustflags = [
      "--cfg",
      "feature=\"panic_immediate_abort\"",
    ]
  }
}

config("is_gtest_unittests") {
  rustflags = [
    "--cfg",
    "is_gtest_unittests",
  ]
}

[Dauer der Verarbeitung: 0.11 Sekunden, vorverarbeitet 2026-08-28]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=476070
#Domains=661743