Skip to content

Commit

Permalink
Glecs GDExtension tweaks, rework VSCode launch and taks, update flecs…
Browse files Browse the repository at this point in the history
…-rs, unittests.yml
  • Loading branch information
GsLogiMaker committed May 3, 2024
1 parent 827d216 commit 7400294
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
--manifest-path \./addons/glecs/rust/glecs/Cargo.toml \
--features compile_bindings \
--target-dir ./addons/glecs/bin
cargo build --release --verbose \
--manifest-path \./addons/glecs/rust/glecs/Cargo.toml \
--features compile_bindings \
--target-dir ./addons/glecs/bin
- uses: croconut/[email protected]
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ addons/glecs/.vscode/settings.json
.godot

.gut_editor_config.json
addons/gut/gui/GutSceneTheme.tres
addons/gut/gui/GutSceneTheme.tres
unittest_log.xml
41 changes: 41 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Game",
"preLaunchTask": "godot-rust: Build Debug",
"type": "lldb",
"request": "launch",
"program": "${config:godot-rust.environment.godotEditorPath}",
"cwd": "${config:godot-rust.environment.godotProjectPath}",
"presentation": {
"group": "Debug",
"order": 1
}
},
{
"name": "Release Game",
"preLaunchTask": "godot-rust: Build Release",
"type": "lldb",
"request": "launch",
"program": "${config:godot-rust.environment.godotEditorPath}",
"cwd": "${config:godot-rust.environment.godotProjectPath}",
"presentation": {
"group": "Debug",
"order": 2
}
},
{
"name": "Attach to Game",
"pid": "${command:pickMyProcess}",
"type": "lldb",
"request": "attach",
"program": "${config:godot-rust.environment.godotEditorPath}",
"port": 6007,
"presentation": {
"group": "Debug",
"order": 3
}
}
]
}
51 changes: 51 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"version": "2.0.0",
"tasks": [
//Godot Editor Operations
{
"label": "godot-rust: Launch Debug Editor",
"detail": "Builds debug rust game library, then opens the project with Godot Editor",
"dependsOn": "godot-rust: Build Debug",
"type": "shell",
"options": {
"cwd": "${config:godot-rust.environment.godotProjectPath}"
},
"command": "${config:godot-rust.environment.godotEditorPath} --editor",
"group": "build"
},
{
"label": "godot-rust: Launch Release Editor",
"detail": "Builds release rust game library, then opens the project with Godot Editor",
"dependsOn": "godot-rust: Build Release",
"type": "shell",
"options": {
"cwd": "${config:godot-rust.environment.godotProjectPath}"
},
"command": "${config:godot-rust.environment.godotEditorPath} --editor",
"group": "build"
},

//Build Operations
{
"label": "godot-rust: Build Debug",
"detail": "Builds debug rust game library",
"type": "shell",
"command": "cargo build --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin",
"group": "build"
},
{
"label": "godot-rust: Build Release",
"detail": "Builds release rust game library",
"type": "shell",
"command": "cargo build --release --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin",
"group": "build"
},
{
"label": "godot-rust: Clean",
"detail": "Removes all artifacts of rust game library and its dependencies",
"type": "shell",
"command": "cargo clean --manifest-path ./addons/glecs/rust/glecs/Cargo.toml --target-dir ./addons/glecs/bin",
"group": "build"
}
]
}
20 changes: 11 additions & 9 deletions addons/glecs/glecs.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ compatibility_minimum = 4.2
reloadable = true

[libraries]
linux.debug.x86_64 = "./rust/glecs/target/debug/libglecs.so"

linux.release.x86_64 = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.so"
windows.debug.x86_64 = "./rust/godot_entities_ecs/target/debug/super_ecgds.dll"
windows.release.x86_64 = "./rust/godot_entities_ecs/target/release/super_ecgds.dll"
macos.debug = "./rust/godot_entities_ecs/target/debug/libsuper_ecgds.dylib"
macos.release = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.dylib"
macos.debug.arm64 = "./rust/godot_entities_ecs/target/debug/libsuper_ecgds.dylib"
macos.release.arm64 = "./rust/godot_entities_ecs/target/release/libsuper_ecgds.dylib"

linux.release.x86_64 = "./bin/release/libglecs.so"
linux.debug.x86_64 = "./bin/debug/libglecs.so"

windows.release.x86_64 = "./bin/release/libglecs.dll"
windows.debug.x86_64 = "./bin/debug/libglecs.dll"

macos.release.x86_64 = "./bin/release/libglecs.dylib"
macos.debug.x86_64 = "./bin/debug/libglecs.dylib"
macos.release.arm64 = "./bin/release/libglecs.dylib"
macos.debug.arm64 = "./bin/debug/libglecs.dylib"
17 changes: 17 additions & 0 deletions addons/glecs/glecs.gdextension.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[configuration]
entry_symbol = "gdext_rust_init"
compatibility_minimum = 4.2
reloadable = true

[libraries]

linux.release.x86_64 = "./bin/x86_64-unknown-linux-gnu/release/libglecs.so"
linux.debug.x86_64 = "./bin/x86_64-unknown-linux-gnu/debug/libglecs.so"

windows.release.x86_64 = "./bin/x86_64-pc-windows-gnu/release/libglecs.dll"
windows.debug.x86_64 = "./bin/x86_64-pc-windows-gnu/debug/libglecs.dll"

macos.release.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.debug.x86_64 = "./bin/x86_64-apple-darwin/debug/libglecs.dylib"
macos.release.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.debug.arm64 = "./bin/x86_64-apple-darwin/debug/libglecs.dylib"
2 changes: 1 addition & 1 deletion addons/glecs/rust/flecs-rs

0 comments on commit 7400294

Please sign in to comment.