Skip to content

Commit

Permalink
Add SUI_FROM_SOURCE env var
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Jul 18, 2024
1 parent 3c741b9 commit bf78123
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
SUI_FROM_SOURCE: true

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ libc = "0.2"
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.48.0", features = ["Win32_System", "Win32_System_LibraryLoader", "Win32_Foundation"] }

[target.'cfg(not(windows))'.build-dependencies]
[build-dependencies]
cmake = "0.1"
8 changes: 3 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ use std::env;
use std::path::PathBuf;

fn main() {
if cfg!(target_os = "windows") {
let from_source = env::var("SUI_FROM_SOURCE").is_ok();
if cfg!(target_os = "windows") && !from_source {
download_prebuilt();
}

#[cfg(not(target_os = "windows"))]
{
} else {
let mut config = cmake::Config::new(".");
config
.define("BUILD_SHARED_LIBS", "OFF")
Expand Down

0 comments on commit bf78123

Please sign in to comment.