Cargo Features
SDL3 has no features set by default.
[dependencies]
sdl3 = { version = "0.11.0", features = ["use-pkg-config", "use-vcpkg", "static-link", "link-framework", "build-from-source", "build-from-source-static", "unsafe_textures", "gfx", "hidapi", "test-mode", "raw-window-handle"] }
- use-pkg-config
-
various ways to link to libsdl3 provided by sdl3-sys: https://github.com/maia-s/sdl3-sys-rs/tree/main/sdl3-sys#usage
Enables use-pkg-config of sdl3-sys
- use-vcpkg
-
sdl3-sys:
Use vcpkg to get link flags for SDL. Only used when not building from source.
The link-static feature has no effect when using vcpkg.
This has no effect if the link-framework feature is enabled. - static-link
-
Enables link-static of sdl3-sys
sdl3-sys:
Link SDL as a static library. The default is to link a shared/dynamic library.
- link-framework
-
Enables link-framework of sdl3-sys
sdl3-sys:
Link SDL as a mac framework. The link-static feature has no effect if this is enabled.
- build-from-source
-
Enables build-from-source of sdl3-sys
sdl3-sys:
Build and link SDL 3 from source instead of linking a pre-existing library
- build-from-source-static
-
Enables build-from-source-static of sdl3-sys
sdl3-sys:
Build and link a static SDL library from source
- unsafe_textures
-
Affects
render::Texture
… - gfx = c_vec
-
Affects
sdl3::gfx
… - hidapi
-
Use hidapi support in SDL. Only 2.0.12 and after
Affects
sdl3::sensor
… - test-mode
-
test_mode allows SDL to be initialised from a thread that is not the main thread
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.
- raw-window-handle implicit feature
-
Enables raw-window-handle ^0.5.0
raw-window-handle:
Interoperability library for Rust Windowing applications
Affects
sdl3::raw_window_handle
… - c_vec gfx?