diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b55589..20f63aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,11 +46,25 @@ jobs: with: toolchain: stable override: true + # When under Windows, add the x86 target as well. + - if: runner.os == 'Windows' + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: i686-pc-windows-msvc + override: true - - name: cargo build + - name: cargo test uses: actions-rs/cargo@v1 with: command: test + # When under Windows, run with the x86 target as well. + - if: runner.os == 'Windows' + name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --target i686-pc-windows-msvc example: name: Example @@ -64,15 +78,36 @@ jobs: with: toolchain: stable override: true + # When under Windows, add the x86 target as well. + - if: runner.os == 'Windows' + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: i686-pc-windows-msvc + override: true - name: cargo build uses: actions-rs/cargo@v1 with: command: build args: --release + # When under Windows, build with the x86 target as well. + - if: runner.os == 'Windows' + name: cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --target i686-pc-windows-msvc --release - name: run example uses: actions-rs/cargo@v1 with: command: run args: --release --example basic + # When under Windows, run with the x86 target as well. + - if: runner.os == 'Windows' + name: run example + uses: actions-rs/cargo@v1 + with: + command: run + args: --target i686-pc-windows-msvc --release --example basic diff --git a/sys/build.rs b/sys/build.rs index 51ef774..3884e52 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -1,5 +1,7 @@ +use std::env; + fn runtime() -> &'static str { - if std::env::var("CARGO_CFG_TARGET_FEATURE") + if env::var("CARGO_CFG_TARGET_FEATURE") .unwrap_or_default() .contains("crt-static") { @@ -9,10 +11,19 @@ fn runtime() -> &'static str { } } +fn arch() -> &'static str { + if env::var("CARGO_CFG_TARGET_ARCH").as_deref() == Ok("x86") { + "x86" + } else { + "x64" + } +} + fn main() { println!( - "cargo:rustc-link-search={}/external/lib/x64/", - std::env!("CARGO_MANIFEST_DIR") + "cargo:rustc-link-search={}/external/lib/{}/", + std::env!("CARGO_MANIFEST_DIR"), + arch(), ); println!("cargo:rustc-link-lib=PerformanceAPI_{}", runtime()); } diff --git a/sys/external/lib/x64/PerformanceAPI_MD.lib b/sys/external/lib/x64/PerformanceAPI_MD.lib index 1d51ec1..1308a86 100644 Binary files a/sys/external/lib/x64/PerformanceAPI_MD.lib and b/sys/external/lib/x64/PerformanceAPI_MD.lib differ diff --git a/sys/external/lib/x64/PerformanceAPI_MT.lib b/sys/external/lib/x64/PerformanceAPI_MT.lib index b6d0f7a..97afe8a 100644 Binary files a/sys/external/lib/x64/PerformanceAPI_MT.lib and b/sys/external/lib/x64/PerformanceAPI_MT.lib differ diff --git a/sys/external/lib/x86/PerformanceAPI_MD.lib b/sys/external/lib/x86/PerformanceAPI_MD.lib new file mode 100644 index 0000000..bfccf2c Binary files /dev/null and b/sys/external/lib/x86/PerformanceAPI_MD.lib differ diff --git a/sys/external/lib/x86/PerformanceAPI_MT.lib b/sys/external/lib/x86/PerformanceAPI_MT.lib new file mode 100644 index 0000000..265d080 Binary files /dev/null and b/sys/external/lib/x86/PerformanceAPI_MT.lib differ