diff --git a/Cargo.toml b/Cargo.toml index e13645c..718812a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "projectm" -version = "3.1.0" +version = "3.1.2" edition = "2021" rust-version = "1.65" authors = ["AnomieVision ", "Mischa Spiegelmock "] @@ -13,8 +13,8 @@ readme = "README.md" [dependencies] libc = "0.2" -#projectm-sys = { path = "projectm-sys", version = "1.0.9-rc.1", features = ["playlist"] } -projectm-sys = { version = "1.2.1" } +#projectm-sys = { path = "projectm-sys", version = "1", features = ["playlist", "static"] } +projectm-sys = { version = "1" } rand = "0.8" [features] diff --git a/projectm-sys/.cargo/config.toml b/projectm-sys/.cargo/config.toml index e2c3513..8a2f47d 100644 --- a/projectm-sys/.cargo/config.toml +++ b/projectm-sys/.cargo/config.toml @@ -1,5 +1,2 @@ [target.wasm32-unknown-emscripten] -linker = ".cargo/linker-emscripten" - -[target.x86_64-unknown-linux-gnu] -rustflags = "-C link-arg=-lGL -C link-arg=-lstdc++ -C link-arg=-lgomp" +linker = ".cargo/linker-emscripten" \ No newline at end of file diff --git a/projectm-sys/Cargo.toml b/projectm-sys/Cargo.toml index 254fc09..1235784 100644 --- a/projectm-sys/Cargo.toml +++ b/projectm-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "projectm-sys" -version = "1.2.1" +version = "1.2.2" edition = "2021" rust-version = "1.65" authors = ["AnomieVision ", "Mischa Spiegelmock "] diff --git a/projectm-sys/build.rs b/projectm-sys/build.rs index cdc7f5f..9786c2a 100644 --- a/projectm-sys/build.rs +++ b/projectm-sys/build.rs @@ -18,7 +18,7 @@ fn build_shared_libs_flag() -> &'static str { if cfg!(feature = "static") { "OFF" // Disable shared libs to enable static linking } else { - "ON" // Enable shared libs + "ON" // Enable shared libs } } @@ -182,6 +182,29 @@ fn main() { } } + // Platform-specific link flags for C++ and OpenGL + #[cfg(target_os = "macos")] + { + println!("cargo:rustc-link-lib=c++"); + println!("cargo:rustc-link-lib=framework=OpenGL"); + } + #[cfg(target_os = "linux")] + { + // On Linux, link stdc++ and GL. + println!("cargo:rustc-link-lib=stdc++"); + println!("cargo:rustc-link-lib=GL"); + println!("cargo:rustc-link-lib=gomp"); + } + #[cfg(target_os = "windows")] + { + println!("cargo:rustc-link-lib=opengl32"); + } + #[cfg(target_os = "emscripten")] + { + // Emscripten typically handles GL calls differently, so you might skip or rely on the + // emscripten compiler for linking. + } + // Generate Rust bindings using bindgen bindgen(); -} \ No newline at end of file +}