forked from dtolnay/cxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
87 lines (78 loc) · 2.59 KB
/
Copy pathCargo.toml
File metadata and controls
87 lines (78 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
[package]
name = "cxx"
version = "1.0.194"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::ffi", "api-bindings", "no-std"]
description = "Safe interop between Rust and C++"
documentation = "https://docs.rs/cxx"
edition = "2021"
exclude = ["/demo", "/gen", "/syntax", "/third-party", "/tools/buck/prelude"]
homepage = "https://cxx.rs"
keywords = ["ffi", "c++"]
license = "MIT OR Apache-2.0"
links = "cxxbridge1"
repository = "https://github.com/dtolnay/cxx"
rust-version = "1.85"
[features]
default = ["std", "cxx-cc/default"] # c++11
"c++14" = ["cxx-cc/c++14"]
"c++17" = ["cxx-cc/c++17"]
"c++20" = ["cxx-cc/c++20"]
# Defers compilation of `cxx.cc` until the bridge generation stage
compile-builtins-at-bridge-stage = ["cxx-cc/compile-at-bridge-stage"]
alloc = []
std = ["alloc", "foldhash/std"]
[dependencies]
cxxbridge-macro = { version = "=1.0.194", path = "macro" }
foldhash = { version = "0.2", default-features = false }
link-cplusplus = "1.0.11"
[build-dependencies]
cxx-cc = { version = "=1.0.194", path = "cxx-cc", default-features = false }
[dev-dependencies]
cc = "1.0.101"
cxx-build = { version = "1", path = "gen/build" }
cxx-gen = { version = "=0.7.194", path = "gen/lib" }
cxx-test-suite = { version = "0", path = "tests/ffi" }
indoc = "2"
proc-macro2 = "1.0.95"
quote = "1.0.40"
rustversion = "1.0.13"
scratch = "1"
target-triple = "1"
tempfile = "3.8"
trybuild = { version = "1.0.108", features = ["diff"] }
# Disallow incompatible version appearing in the same lockfile.
[target.'cfg(any())'.build-dependencies]
cxx-build = { version = "=1.0.194", path = "gen/build" }
cxxbridge-cmd = { version = "=1.0.194", path = "gen/cmd" }
[workspace]
members = ["cxx-cc", "demo", "flags", "gen/build", "gen/cmd", "gen/lib", "macro", "tests/ffi"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = [
"--generate-link-to-definition",
"--generate-macro-expansion",
"--extern-html-root-url=core=https://doc.rust-lang.org",
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
"--extern-html-root-url=std=https://doc.rust-lang.org",
]
[package.metadata.bazel]
additive_build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "cxx_cc",
srcs = ["src/cxx.cc"],
hdrs = ["include/cxx.h"],
include_prefix = "rust",
includes = ["include"],
linkstatic = True,
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
"""
deps = [":cxx_cc"]
extra_aliased_targets = { cxx_cc = "cxx_cc" }
gen_build_script = false
[patch.crates-io]
cxx = { path = "." }
cxx-build = { path = "gen/build" }