Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sapp-kms: Support linux in KMS mode #158

Merged
merged 2 commits into from Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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");
}