Skip to content

Commit 71f30fc

Browse files
authored
Merge pull request #33 from ShaneMurphy2/bug/fix-build-script-platform-behavior
Fix build script platform behavior
2 parents 7a1a529 + 78b1abc commit 71f30fc

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
- clap v4.4
1414
- thiserror v2.0
1515
- [PR #32](https://github.com/fpagliughi/rust-industrial-io/pull/32) Typo in `ChannelType::Light`
16+
- [PR #33](https://github.com/fpagliughi/rust-industrial-io/pull/33) Fix build script platform behavior
1617

1718

1819
### [v0.6.0](https://github.com/fpagliughi/rust-industrial-io/compare/v0.5.2..v0.6.0) - 2024-12-10

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "industrial-io"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
edition = "2021"
55
rust-version = "1.73.0"
66
authors = ["Frank Pagliughi <[email protected]>"]

libiio-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libiio-sys"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
edition = "2021"
55
rust-version = "1.73.0"
66
authors = ["Frank Pagliughi <[email protected]>"]

libiio-sys/build.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use std::env;
1414

15-
#[cfg(target_os = "macos")]
1615
fn config_macos() {
1716
println!("cargo:rustc-link-lib=framework=iio");
1817

@@ -42,9 +41,12 @@ fn main() {
4241
#[cfg(feature = "libiio_v0_21")]
4342
println!("debug: Using bindings for libiio v0.21");
4443

45-
#[cfg(not(target_os = "macos"))]
46-
println!("cargo:rustc-link-lib=iio");
44+
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
4745

48-
#[cfg(target_os = "macos")]
49-
config_macos();
46+
if target_os == "linux" {
47+
println!("cargo:rustc-link-lib=iio");
48+
}
49+
else if target_os == "macos" {
50+
config_macos();
51+
}
5052
}

0 commit comments

Comments
 (0)