Bug 1351803 - Statically link to avrt.lib on Windows, when compiling cubeb. r?glandium draft
authorPaul Adenot <paul@paul.cx>
Thu, 30 Mar 2017 06:26:19 -0700
changeset 553695 ca58c33d0995c27283bc09108fa63c79a65d73f8
parent 553413 60d7a0496a3673450ddbc37ec387525148c32604
child 622145 68485164d5d2888c5d38af364c3636616972e212
push id51724
push userbmo:padenot@mozilla.com
push dateThu, 30 Mar 2017 13:47:44 +0000
reviewersglandium
bugs1351803
milestone55.0a1
Bug 1351803 - Statically link to avrt.lib on Windows, when compiling cubeb. r?glandium We used to get the symbols we need using `LoadLibrary`, but now (since https://github.com/kinetiknz/cubeb/commit/661c653c8650b2b1c485e86b5a5b4f6d0ed07d1b), we can statically link to avrt.lib, because we only support Windows OSes that have this library. For now, this works because avrt.lib is linked in webrtc-land somewhere with a #pragma, but: - We're going to stop using this bit of webrtc in the near future (around Firefox 54) - Not linking this explicitely where it's used breaks --disable-webrtc, that is a popular option MozReview-Commit-ID: 7b16Kdl3VUu
media/libcubeb/src/moz.build
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -63,16 +63,19 @@ if CONFIG['OS_TARGET'] == 'Darwin':
 if CONFIG['OS_TARGET'] == 'WINNT':
     SOURCES += [
         'cubeb_resampler.cpp',
         'cubeb_wasapi.cpp',
         'cubeb_winmm.c',
     ]
     DEFINES['USE_WINMM'] = True
     DEFINES['USE_WASAPI'] = True
+    OS_LIBS += [
+      "avrt",
+    ]
     if CONFIG['_MSC_VER']:
         CXXFLAGS += ['-wd4005'] # C4005: '_USE_MATH_DEFINES' : macro redefinition
 
 if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += ['cubeb_opensl.c']
     SOURCES += ['cubeb_resampler.cpp']
     DEFINES['USE_OPENSL'] = True
     if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':