objc2 0.3.0-beta.0

Objective-C interface and runtime bindings
Documentation
[package]
name = "objc2"
version = "0.3.0-beta.0" # Remember to update html_root_url in lib.rs
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2021"

description = "Objective-C interface and runtime bindings"
keywords = ["objective-c", "macos", "ios", "objc_msgSend"]
categories = [
    "api-bindings",
    "development-tools::ffi",
    "os::macos-apis",
]
readme = "README.md"
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc2/"
license = "MIT"

# NOTE: 'unstable' features are _not_ considered part of the SemVer contract,
# and may be removed in a minor release.
[features]
default = ["apple"]

# Enables `objc2::exception::throw` and `objc2::exception::catch`
exception = ["objc-sys/unstable-exception"]

# Wrap every `objc2::msg_send` call in a `@try/@catch` block
catch_all = ["exception"]

# Verify type encodings on every message send
# Only intended to be used while debugging!
verify_message = ["malloc"] # TODO: Remove malloc feature here

# Expose features that require linking to `libc::free`.
#
# This is not enabled by default because most users won't need it, and it
# increases compilation time.
malloc = ["malloc_buf"]

# Uses nightly features to make AutoreleasePool zero-cost even in debug mode
unstable-autoreleasesafe = []

# Runtime selection. See `objc-sys` for details.
apple = ["objc-sys/apple"]
gnustep-1-7 = ["objc-sys/gnustep-1-7"]
gnustep-1-8 = ["gnustep-1-7", "objc-sys/gnustep-1-8"]
gnustep-1-9 = ["gnustep-1-8", "objc-sys/gnustep-1-9"]
gnustep-2-0 = ["gnustep-1-9", "objc-sys/gnustep-2-0"]
gnustep-2-1 = ["gnustep-2-0", "objc-sys/gnustep-2-1"]

[dependencies]
malloc_buf = { version = "1.0", optional = true }
objc-sys = { path = "../objc-sys", version = "=0.2.0-beta.0", default-features = false }
objc2-encode = { path = "../objc2-encode", version = "=2.0.0-pre.0", default-features = false }

[dev-dependencies]
iai = { version = "0.1", git = "https://github.com/madsmtm/iai", branch = "callgrind" }

[[bench]]
name = "autorelease"
harness = false

[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
features = ["exception", "malloc"]

targets = [
    # MacOS
    "x86_64-apple-darwin",
    "aarch64-apple-darwin",
    # "i686-apple-darwin",
    # iOS
    "aarch64-apple-ios",
    "x86_64-apple-ios",
    # "armv7-apple-ios",
    # "i386-apple-ios",
    # GNUStep
    "x86_64-unknown-linux-gnu",
    "i686-unknown-linux-gnu",
    # Windows
    "x86_64-pc-windows-msvc",
]