forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The glue is done using the [cxx crate](https://cxx.rs/) on the Rust side. As a proof-of-concept, only a small console command (`rust_version`) printing the currently used Rust version was added. You can generate and open the Rust documentation using `DDNET_TEST_NO_LINK=1 cargo doc --open`. You can run the Rust tests using `cmake --build <build dir> --target run_rust_tests`, they're automatically included in the `run_tests` target as well. Rust tests don't work on Windows in debug mode on Windows because Rust cannot currently link with the debug version of the C stdlib on Windows: rust-lang/rust#39016. --- The stuff in `src/rust-bridge` is generated using ``` cxxbridge src/engine/shared/rust_version.rs --output src/rust-bridge/engine/shared/rust_version.cpp --output src/rust-bridge/engine/shared/rust_version.h cxxbridge src/engine/console.rs --output src/rust-bridge/cpp/console.cpp --output src/rust-bridge/cpp/console.h ```
- Loading branch information
1 parent
1b114b2
commit e093e94
Showing
48 changed files
with
1,916 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.'cfg(target_env = "msvc")'] | ||
rustflags = ["-C", "target-feature=+crt-static"] |
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,42 @@ | ||
name: Check Rust | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- staging.tmp | ||
- trying.tmp | ||
- staging-squash-merge.tmp | ||
pull_request: | ||
|
||
jobs: | ||
rustdoc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Rustdoc | ||
run: | | ||
RUSTDOCFLAGS=-Dwarnings DDNET_TEST_NO_LINK=1 cargo doc | ||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Rustfmt | ||
run: | ||
cargo fmt -- --check | ||
|
||
cargo-deny: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
checks: | ||
- advisories | ||
- bans licenses sources | ||
|
||
continue-on-error: ${{ matrix.checks == 'advisories' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
with: | ||
command: check ${{ matrix.checks }} |
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
Oops, something went wrong.