Skip to content

Commit

Permalink
Embed bindings via windows-core
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Aug 18, 2023
1 parent 419aea5 commit a4a0de4
Show file tree
Hide file tree
Showing 6 changed files with 2,428 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android_system_properties = "0.1.5"
core-foundation-sys = "0.8.3"

[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.48.0", features = [ "Globalization" ] }
windows-core = { version = "0.51.1" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.50"
Expand All @@ -38,5 +38,5 @@ wasm-bindgen-test = "0.3"
iana-time-zone-haiku = { version = "0.1.1", path = "haiku" }

[workspace]
members = [".", "haiku"]
members = [".", "haiku", "api_gen"]
default-members = ["."]
8 changes: 8 additions & 0 deletions api_gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "api_gen"
version = "0.0.0"
edition = "2021"
publish = false

[dependencies]
windows-bindgen = "0.51"
7 changes: 7 additions & 0 deletions api_gen/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use windows_bindgen::{bindgen, Result};

fn main() -> Result<()> {
let log = bindgen(["--etc", "bindings.txt"])?;
println!("{}", log);
Ok(())
}
16 changes: 16 additions & 0 deletions bindings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--out src/Windows.rs

--filter
Windows.Globalization.Calendar

# Dependencies of the above
Windows.Foundation.Collections.IIterable
Windows.Foundation.Collections.IIterator
Windows.Foundation.Collections.IVectorView
Windows.Foundation.DateTime
Windows.Foundation.TimeSpan
Windows.Globalization.DayOfWeek
Windows.Globalization.ICalendar
Windows.Globalization.ICalendarFactory
Windows.Globalization.ICalendarFactory2
Windows.Globalization.ITimeZoneOnCalendar

0 comments on commit a4a0de4

Please sign in to comment.