From 842cda6865ca297135f53083bd013aa91abb5587 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 27 Aug 2024 15:15:08 +1000 Subject: [PATCH] Always include `WindowsMMap.c` in the list of source files The whole file is surrounded by `#if defined(_WIN32)`, so there's no need to have separate logic to exclue it from non-Windows builds. --- library/profiler_builtins/build.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs index 6089937e0b7a..93048a6dec75 100644 --- a/library/profiler_builtins/build.rs +++ b/library/profiler_builtins/build.rs @@ -19,7 +19,7 @@ fn main() { // FIXME: `rerun-if-changed` directives are not currently emitted and the build script // will not rerun on changes in these source files or headers included into them. - let mut profile_sources = vec![ + let profile_sources = vec![ // tidy-alphabetical-start "GCDAProfiling.c", "InstrProfiling.c", @@ -40,13 +40,13 @@ fn main() { "InstrProfilingValue.c", "InstrProfilingVersionVar.c", "InstrProfilingWriter.c", + "WindowsMMap.c", // tidy-alphabetical-end ]; if target_env == "msvc" { // Don't pull in extra libraries on MSVC cfg.flag("/Zl"); - profile_sources.push("WindowsMMap.c"); cfg.define("strdup", Some("_strdup")); cfg.define("open", Some("_open")); cfg.define("fdopen", Some("_fdopen")); @@ -61,8 +61,6 @@ fn main() { if target_os != "windows" { cfg.flag("-fvisibility=hidden"); cfg.define("COMPILER_RT_HAS_UNAME", Some("1")); - } else { - profile_sources.push("WindowsMMap.c"); } }