Skip to content

Commit 6fad9d0

Browse files
authored
Link flags (#19)
* chore: Release projectm version 3.1.1 * fmt * Platform link flags * chore: Release projectm-sys version 1.2.2 * sys * chore: Release projectm version 3.1.2
1 parent e9f629c commit 6fad9d0

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "projectm"
3-
version = "3.1.0"
3+
version = "3.1.2"
44
edition = "2021"
55
rust-version = "1.65"
66
authors = ["AnomieVision <[email protected]>", "Mischa Spiegelmock <[email protected]>"]
@@ -13,8 +13,8 @@ readme = "README.md"
1313

1414
[dependencies]
1515
libc = "0.2"
16-
#projectm-sys = { path = "projectm-sys", version = "1.0.9-rc.1", features = ["playlist"] }
17-
projectm-sys = { version = "1.2.1" }
16+
#projectm-sys = { path = "projectm-sys", version = "1", features = ["playlist", "static"] }
17+
projectm-sys = { version = "1" }
1818
rand = "0.8"
1919

2020
[features]

projectm-sys/.cargo/config.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
[target.wasm32-unknown-emscripten]
2-
linker = ".cargo/linker-emscripten"
3-
4-
[target.x86_64-unknown-linux-gnu]
5-
rustflags = "-C link-arg=-lGL -C link-arg=-lstdc++ -C link-arg=-lgomp"
2+
linker = ".cargo/linker-emscripten"

projectm-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 = "projectm-sys"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
edition = "2021"
55
rust-version = "1.65"
66
authors = ["AnomieVision <[email protected]>", "Mischa Spiegelmock <[email protected]>"]

projectm-sys/build.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn build_shared_libs_flag() -> &'static str {
1818
if cfg!(feature = "static") {
1919
"OFF" // Disable shared libs to enable static linking
2020
} else {
21-
"ON" // Enable shared libs
21+
"ON" // Enable shared libs
2222
}
2323
}
2424

@@ -182,6 +182,29 @@ fn main() {
182182
}
183183
}
184184

185+
// Platform-specific link flags for C++ and OpenGL
186+
#[cfg(target_os = "macos")]
187+
{
188+
println!("cargo:rustc-link-lib=c++");
189+
println!("cargo:rustc-link-lib=framework=OpenGL");
190+
}
191+
#[cfg(target_os = "linux")]
192+
{
193+
// On Linux, link stdc++ and GL.
194+
println!("cargo:rustc-link-lib=stdc++");
195+
println!("cargo:rustc-link-lib=GL");
196+
println!("cargo:rustc-link-lib=gomp");
197+
}
198+
#[cfg(target_os = "windows")]
199+
{
200+
println!("cargo:rustc-link-lib=opengl32");
201+
}
202+
#[cfg(target_os = "emscripten")]
203+
{
204+
// Emscripten typically handles GL calls differently, so you might skip or rely on the
205+
// emscripten compiler for linking.
206+
}
207+
185208
// Generate Rust bindings using bindgen
186209
bindgen();
187-
}
210+
}

0 commit comments

Comments
 (0)