Skip to content

Commit

Permalink
remove sokol_imgui.h bindings, example and cimgui submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Feb 29, 2024
1 parent 0254fed commit f61e2e5
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 3,638 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup-rust
uses: dtolnay/rust-toolchain@master
with:
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "src/sokol/c/cimgui"]
path = src/sokol/c/cimgui
url = https://github.com/cimgui/cimgui.git
shallow = true
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,9 @@ cargo run --example instancing
cargo run --example userdata
```

>NOTE: The imgui sample currently doesn't work, see the note about lib.rs here [here](https://github.com/floooh/sokol-rust/issues/4#issuecomment-1489105274), and [this issue](https://github.com/floooh/sokol-rust/issues/3) for a clean solution.
To run the imgui example, you need to go into it's directory:
```console
cd examples/imgui
cargo run
```
>NOTE: imgui support has been removed for now, the required cimgui submodule dependency caused trouble with
> Github Actions. We'll need to solve this some other way in the future, and in a way that works for all
> language bindings.
## Wasm/Emscripten
To compile for wasm, you will need the emcc compiler which you can get at https://github.com/emscripten-core/emsdk
Expand Down
47 changes: 0 additions & 47 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,54 +267,7 @@ fn make_sokol() {
build.compile("sokol-rust");
}

fn make_imgui() {
let mut build = cc::Build::new();
let tool = build.try_get_compiler().unwrap();

let config = get_compilation_config(&tool);
const BASE_C_DIR: &str = "src/sokol/c/";

if !config.is_debug_build {
build.define("NDEBUG", None);
build.opt_level(2);
}

let _backend = select_sokol_backend(&mut build, &config);
let files = ["sokol_imgui.c"];

//
// include paths
//
build.include(BASE_C_DIR);
build.define("IMPL", None);

build.flag_if_supported("-Wno-unused-parameter").flag_if_supported("-Wno-missing-field-initializers");

for file in &files {
let file = format!("{BASE_C_DIR}{file}");

println!("cargo:rerun-if-changed={file}");

if config.build_target == BuildTarget::Macos {
build.flag("-ObjC");
}

build.file(file);
}

if config.debug_info_requested {
build.define("_DEBUG", None).define("SOKOL_DEBUG", None);
}
build.define("IMGUI_DISABLE_OBSOLETE_FUNCTIONS", None);

build.compile("sokol-rust-imgui");
}

fn main() {
println!("cargo:rerun-if-changed=build.rs");

make_sokol();

#[cfg(feature = "imgui")]
make_imgui();
}
72 changes: 0 additions & 72 deletions examples/imgui/Cargo.lock

This file was deleted.

10 changes: 0 additions & 10 deletions examples/imgui/Cargo.toml

This file was deleted.

105 changes: 0 additions & 105 deletions examples/imgui/src/main.rs

This file was deleted.

Loading

0 comments on commit f61e2e5

Please sign in to comment.