Skip to content

Commit

Permalink
Add LIBPD_CRT_LINKAGE flag
Browse files Browse the repository at this point in the history
  • Loading branch information
alisomay committed Nov 28, 2024
1 parent 91367ad commit 195adea
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ fn main() {

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

// For windows we need to link pthread.
// There are some prebuilt libraries for msvc and mingw for architectures x64 and arm64.
// Mingw support is not tested yet but should work.
Expand Down Expand Up @@ -144,12 +136,7 @@ fn main() {

let mut lib_destination = Config::new("libpd");
if compiler.as_str() == "msvc" {
lib_destination.define("CMAKE_C_FLAGS_INIT", msvc_runtime_flag);

lib_destination.cflag("/MD"); // Force /MD runtime library
lib_destination.cflag("/experimental:c11atomics");
lib_destination.cflag("/wd4091");
lib_destination.cflag("/wd4996");
lib_destination.define("LIBPD_CRT_LINKAGE", "dynamic");
}
lib_destination
.define("PD_LOCALE", PD_LOCALE)
Expand Down

0 comments on commit 195adea

Please sign in to comment.