Skip to content

Commit

Permalink
Add Windows job.
Browse files Browse the repository at this point in the history
Builds the use-rust-in-c example in Visual Studio.
  • Loading branch information
jonathanpallant committed Nov 19, 2024
1 parent ca76424 commit 9a9c264
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,20 @@ jobs:
if-no-files-found: error
path: |
./rust-training-*/
build-windows-examples:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Update Rust
run: |
rustup update stable
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build FFI Example
run: |
cd example-code\native\ffi\use-rust-in-c\windows-example
msbuild.exe windows-example.sln /p:Configuration=Debug
.\x64\Debug\windows-example.exe
msbuild.exe windows-example.sln /p:Configuration=Release
.\x64\Release\windows-example.exe
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(ProjectPath)\..\..\target\debug\ffi_use_rust_in_c.lib;kernel32.lib;advapi32.lib;ntdll.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(ProjectDir)\..\target\debug\ffi_use_rust_in_c.lib;kernel32.lib;advapi32.lib;ntdll.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
<Command>cd $(ProjectPath)\..
<Command>cd $(ProjectDir)\..
cargo build
</Command>
</PreBuildEvent>
Expand All @@ -134,7 +134,7 @@ cargo build
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(ProjectPath)\..\..\target\release\ffi_use_rust_in_c.lib;kernel32.lib;advapi32.lib;ntdll.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(ProjectDir)\..\target\release\ffi_use_rust_in_c.lib;kernel32.lib;advapi32.lib;ntdll.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
<PreBuildEvent>
Expand Down

0 comments on commit 9a9c264

Please sign in to comment.