about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarco Castelluccio <mcastelluccio@mozilla.com>2017-06-12 23:08:08 +0100
committerMarco Castelluccio <mcastelluccio@mozilla.com>2017-06-12 23:08:08 +0100
commit900ba559b637b6d99bc95e6f0d270543713096fd (patch)
tree6e21a5eee51d76be308a67591299e27a1b43f346
parentce56daf37b7b5b101db7ef895e6be4586d80d08e (diff)
Compile WindowsMMap too on MSVC
-rw-r--r--src/libprofiler_builtins/build.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/libprofiler_builtins/build.rs b/src/libprofiler_builtins/build.rs
index a9685ca7e1a..4397d2ebb21 100644
--- a/src/libprofiler_builtins/build.rs
+++ b/src/libprofiler_builtins/build.rs
@@ -21,9 +21,24 @@ fn main() {
     let target = env::var("TARGET").expect("TARGET was not set");
     let cfg = &mut gcc::Config::new();
 
+    let mut profile_sources = vec!["GCDAProfiling.c",
+                                   "InstrProfiling.c",
+                                   "InstrProfilingBuffer.c",
+                                   "InstrProfilingFile.c",
+                                   "InstrProfilingMerge.c",
+                                   "InstrProfilingMergeFile.c",
+                                   "InstrProfilingPlatformDarwin.c",
+                                   "InstrProfilingPlatformLinux.c",
+                                   "InstrProfilingPlatformOther.c",
+                                   "InstrProfilingRuntime.cc",
+                                   "InstrProfilingUtil.c",
+                                   "InstrProfilingValue.c",
+                                   "InstrProfilingWriter.c"];
+
     if target.contains("msvc") {
         // Don't pull in extra libraries on MSVC
         cfg.flag("/Zl");
+        profile_sources.push("WindowsMMap.c");
     } else {
         // Turn off various features of gcc and such, mostly copying
         // compiler-rt's build system already
@@ -34,20 +49,6 @@ fn main() {
         cfg.define("VISIBILITY_HIDDEN", None);
     }
 
-    let profile_sources = &["GCDAProfiling.c",
-                            "InstrProfiling.c",
-                            "InstrProfilingBuffer.c",
-                            "InstrProfilingFile.c",
-                            "InstrProfilingMerge.c",
-                            "InstrProfilingMergeFile.c",
-                            "InstrProfilingPlatformDarwin.c",
-                            "InstrProfilingPlatformLinux.c",
-                            "InstrProfilingPlatformOther.c",
-                            "InstrProfilingRuntime.cc",
-                            "InstrProfilingUtil.c",
-                            "InstrProfilingValue.c",
-                            "InstrProfilingWriter.c"];
-
     for src in profile_sources {
         cfg.file(Path::new("../compiler-rt/lib/profile").join(src));
     }