-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back dprectool, dragging Rust along with it
It should work mostly the same, the command line flags are the same and the behavior should also match up for the most part. This reintroduces Rust into the project, only at the fringes for now, so it can yet be avoided with -DTOOLS=OFF. But it will probably be integrated into Drawdance to deal with stuff like file handling and such, where using C is just terrible damage. The integration is less of a back-and-forth mess than it was with Rustpile, since we no longer do any linking in Rust space, we only produce static libraries in it and let cmake deal with actually putting the executables together.
- Loading branch information
1 parent
45deaf3
commit 38b741d
Showing
18 changed files
with
1,075 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "drawdance" | ||
version = "2.2.0-pre" | ||
edition = "2021" | ||
|
||
[lib] | ||
path = "lib.rs" | ||
|
||
[build-dependencies] | ||
bindgen = "0.66.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: MIT | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=wrapper.h"); | ||
|
||
let bindings = bindgen::Builder::default() | ||
.header("wrapper.h") | ||
.clang_arg("-I../bundled") | ||
.clang_arg("-I../libcommon") | ||
.clang_arg("-I../libmsg") | ||
.clang_arg("-I../libengine") | ||
.allowlist_function("(DP|json)_.*") | ||
.allowlist_type("(DP|JSON)_.*") | ||
.allowlist_var("DP_.*") | ||
.parse_callbacks(Box::new(bindgen::CargoCallbacks)) | ||
.prepend_enum_name(false) | ||
.generate() | ||
.expect("Couldn't generate bindings for drawdance"); | ||
|
||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
bindings | ||
.write_to_file(out_path.join("bindings.rs")) | ||
.expect("Couldn't write bindings for drawdance"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
mod player; | ||
mod recorder; | ||
|
||
pub use player::{Player, PlayerError}; | ||
pub use recorder::{Recorder, RecorderError}; |
Oops, something went wrong.