Skip to content

Commit

Permalink
feat: static lib build on windows
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Sep 12, 2024
1 parent ded5e87 commit 835894d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
4 changes: 1 addition & 3 deletions kclvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = [
"cdylib",
]
crate-type = ["cdylib", "staticlib"]
path = "src/lib.rs"
name = "kclvm_cli_cdylib"

Expand Down
1 change: 1 addition & 0 deletions scripts/build-windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ New-Item -ErrorAction Ignore -Path ".\_output\kclvm-windows\include" -ItemType "
Copy-Item -Path "..\..\kclvm\target\release\kclvm_cli_cdylib.dll" -Destination ".\_output\kclvm-windows\bin\kclvm_cli_cdylib.dll" -Force
Copy-Item -Path "..\..\kclvm\target\release\kclvm_cli_cdylib.dll.lib" -Destination ".\_output\kclvm-windows\bin\kclvm_cli_cdylib.lib" -Force
Copy-Item -Path "..\..\kclvm\target\release\kclvm_cli_cdylib.dll.lib" -Destination "..\..\kclvm\target\release\kclvm_cli_cdylib.lib" -Force
Copy-Item -Path "..\..\kclvm\target\release\libkclvm_cli_cdylib.a" -Destination ".\_output\kclvm-windows\bin\libkclvm_cli_cdylib.a" -Force

Set-Location $PSScriptRoot
# 2. Install kclvm CLI
Expand Down

0 comments on commit 835894d

Please sign in to comment.