Skip to content

Commit

Permalink
sapp-kms: Support linux in KMS mode
Browse files Browse the repository at this point in the history
  • Loading branch information
not-fl3 committed Dec 6, 2020
1 parent 6738cdc commit 2225822
Show file tree
Hide file tree
Showing 12 changed files with 46,134 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Cargo.toml
Expand Up @@ -14,7 +14,8 @@ keywords = ["graphics", "3D", "opengl", "gamedev", "windowing"]
categories = ["rendering::graphics-api"]

[features]
default = []
default = ["sapp-linux"]
kms = ["sapp-kms"]

# Optional log-rs like macros implementation
# disabled by default
Expand All @@ -24,7 +25,9 @@ log-impl = []
sapp-windows = { path ="./native/sapp-windows", version = "=0.2.13" }

[target.'cfg(target_os = "linux")'.dependencies]
sapp-linux = { path ="./native/sapp-linux", version = "=0.1.9" }
sapp-linux = { path ="./native/sapp-linux", version = "=0.1.9", optional = true }

sapp-kms = { path ="./native/sapp-kms", version = "=0.1.0", optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
sapp-darwin = { path = "./native/sapp-darwin", version = "=0.1.3" }
Expand Down
3 changes: 3 additions & 0 deletions native/sapp-kms/.gitignore
@@ -0,0 +1,3 @@
/target
*/.rs.bk
Cargo.lock
18 changes: 18 additions & 0 deletions native/sapp-kms/Cargo.toml
@@ -0,0 +1,18 @@
[package]
name = "sapp-kms"
version = "0.1.0"
authors = ["not-fl3 <not.fl3@gmail.com>"]
edition = "2018"
license = "MIT/Apache-2.0"
build = "build.rs"
description = """
Part of miniquad rendering library.
Orignally this was a sokol-app C code transpiled to rust with c2rust and partially rewritten to more idiomatic rust.
"""
homepage = "https://github.com/not-fl3/miniquad"

[dependencies]
libc = "0.2"

[build-dependencies]
cc = "1.0"
7 changes: 7 additions & 0 deletions native/sapp-kms/build.rs
@@ -0,0 +1,7 @@

fn main() {
println!("cargo:rustc-link-lib=dylib=GLESv2");
println!("cargo:rustc-link-lib=dylib=EGL");
println!("cargo:rustc-link-lib=dylib=drm");
println!("cargo:rustc-link-lib=dylib=gbm");
}

0 comments on commit 2225822

Please sign in to comment.