Skip to content

Commit a3840f6

Browse files
committed
fix: remove -lm flag for windows
1 parent b897b6d commit a3840f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/moonutil/src/compiler_flags.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ where
461461

462462
// Link against some common libraries
463463
if cc.is_gcc_like() {
464-
if cc.is_full_featured_gcc_like() {
464+
if !cfg!(target_os = "windows") && cc.is_full_featured_gcc_like() {
465465
buf.push("-lm".to_string());
466466
}
467467
if let Some(dyn_lib_path) = config.link_shared_runtime.as_ref() {
@@ -655,7 +655,10 @@ where
655655
buf.extend(src.iter().map(|s| s.as_ref().to_string()));
656656

657657
// Link against some common libraries
658-
if cc.is_full_featured_gcc_like() && config.output_ty != OutputType::Object {
658+
if !cfg!(target_os = "windows")
659+
&& cc.is_full_featured_gcc_like()
660+
&& config.output_ty != OutputType::Object
661+
{
659662
buf.push("-lm".to_string());
660663
}
661664

0 commit comments

Comments
 (0)