Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
alisomay committed Nov 28, 2024
1 parent 7f1af6c commit 7c84bfc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libpd-sys"
version = "0.3.3"
version = "0.3.4"
authors = ["alisomay <[email protected]>"]
edition = "2021"
license = "BSD-3-Clause"
Expand Down
21 changes: 14 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ fn main() {

#[cfg(target_os = "windows")]
{
// Determine the appropriate CRT linkage
let profile = std::env::var("PROFILE").unwrap();
let crt_linkage = if profile == "release" {
"MultiThreadedDLL"
let msvc_runtime_flag = if profile == "release" {
"/MD" // Multithreaded DLL
} else {
"MultiThreadedDebugDLL"
"/MDd" // Multithreaded Debug DLL
};

// For windows we need to link pthread.
Expand Down Expand Up @@ -140,23 +141,29 @@ fn main() {
_ => panic!("Unsupported architecture: {}", target_info.arch),
};

let lib_destination = Config::new("libpd")
let mut lib_destination = Config::new("libpd");

lib_destination
.define("PD_LOCALE", PD_LOCALE)
.define("PD_MULTI", PD_MULTI)
.define("PD_UTILS", PD_UTILS)
.define("PD_EXTRA", PD_EXTRA)
.define("LIBPD_RS_EXTRA", LIBPD_RS_EXTRA)
.define("PTHREADS_LIB", pthread_lib_path.to_str().unwrap())
.define("PTHREADS_INCLUDE_DIR", pthread_include.to_str().unwrap())
.define("CMAKE_MSVC_RUNTIME_LIBRARY", crt_linkage)
.cflag(format!("-DWISH={}", WISH))
.cflag(format!("-I{}", libpd_wrapper_dir.to_str().unwrap()))
.cflag(format!("-I{}", pd_source.to_str().unwrap()))
.cflag(format!("-DPD_FLOATSIZE={PD_FLOATSIZE}"))
.no_build_target(true)
.always_configure(true)
.very_verbose(true)
.build();
.very_verbose(true);

if target_info.compiler.unwrap() == "msvc" {
lib_destination.cflag(msvc_runtime_flag);
}

let lib_destination = lib_destination.build();

let library_root = lib_destination.join("build/libs");

Expand Down

0 comments on commit 7c84bfc

Please sign in to comment.