Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build
dist
node_modules
target

.merlin
.cljs_node_repl
Expand Down
259 changes: 259 additions & 0 deletions rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[workspace]
members = ["cli", "elementary"]
default-members = ["elementary"]
resolver = "2"

[workspace.package]
authors = ["The Elementary Authors"]
categories = ["multimedia::audio"]
edition = "2021"
license = "MIT"
repository = "https://github.com/elemaudio/elementary"
rust-version = "1.75.0"
# TODO Update on release
version = "5.0.0"

[workspace.dependencies]

[profile.dev.package."*"]
debug-assertions = false

# Speedup build on macOS
# See https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#splitting-debug-information
[profile.dev]
debug-assertions = true
split-debuginfo = "unpacked"

[profile.release]
# Will slow-down compile, but improve perf on generated code.
codegen-units = 1
20 changes: 20 additions & 0 deletions rs/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "elementary-cli"
publish = false
version = { workspace = true }
description = "An example CLI project demonstrating Elementary Audio runtime bindings"
license = { workspace = true }
readme = "README.md"
repository = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }

[[bin]]
name = "elementary"
path = "src/main.rs"
doc = false
bench = false

[dependencies]
# TODO Update version on release
elementary = { version = "5.0.0", path = "../elementary" }
1 change: 1 addition & 0 deletions rs/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
5 changes: 5 additions & 0 deletions rs/cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use elementary::say_name;

fn main() {
println!("Hello from {}!", say_name());
}
26 changes: 26 additions & 0 deletions rs/elementary/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "elementary"
version = { workspace = true }
description = "Elementary Audio runtime bindings"
keywords = ["audio", "dsp"]
categories = { workspace = true }
license = { workspace = true }
readme = "README.md"
# TODO Update with appropriate docs link
documentation = "https://www.elementary.audio/docs"
repository = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }

[lib]
path = "src/lib.rs"
bench = false
doctest = true

[dependencies]
ciborium = "0.2.2"
cxx = "1.0"

[build-dependencies]
cxx-build = "1.0"
1 change: 1 addition & 0 deletions rs/elementary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
11 changes: 11 additions & 0 deletions rs/elementary/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn main() {
cxx_build::bridge("src/lib.rs")
.flag_if_supported("-std=c++20")
.compile("elementary");

println!("cargo:rerun-if-changed=src/lib.rs");
println!("cargo:rerun-if-changed=src/include/Main.cpp");
println!("cargo:rerun-if-changed=src/include/Runtime.h");
println!("cargo:rerun-if-changed=src/include/cxx.h");
println!("cargo:rerun-if-changed=src/include/JSON.h");
}
2 changes: 2 additions & 0 deletions rs/elementary/compile_flags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-xc++
-std=c++20
Loading