compiling webrtc with clang and libc++

401 views
Skip to first unread message

Alexandre GOUAILLARD

unread,
Dec 16, 2015, 8:33:57 AM12/16/15
to discuss...@googlegroups.com
hi,

by default it seems that webrtc is being compiled with libstdc++ on mac.
How to change that to libc++

I googled, i tries the diffenrent GYP_DEFINES< modified the common.gypi, could t make it happen.

thanks in advance.

alex.


--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
Principal Architect - Citrix, San Francisco
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

Dmitry Sobinov

unread,
Dec 16, 2015, 5:35:28 PM12/16/15
to discuss-webrtc
If you need static libs only, you can try following patch (maybe that's enough for .dylib, we didn't check):

 
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -5255,6 +5255,7 @@
         'xcode_settings': {
           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
                                                     # (Equivalent to -fPIC)
+          'CLANG_CXX_LIBRARY': 'libc++',
           # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min


Chromium switched to libc++ recently, so hopefully we won't need these hacks anymore: https://code.google.com/p/chromium/issues/detail?id=400091

Regards,
Dmitry

Alexandre GOUAILLARD

unread,
Dec 16, 2015, 6:07:01 PM12/16/15
to discuss...@googlegroups.com
thanks,

I finally managed to do it.

I had added the same line you did in common.gypi, copied from the iOS section.
I also removed Werror that was bumping on undefined W.

I also put some GYP_DEFINES variables:

GYP_DEFINES=clang=1 clang_xcode=1 use_system_libcxx=1 OS=mac target_arch=x64


and GENERATORS

GYP_GENERATORS=ninja,xcode-ninja


I ended up with the Xcode provided clang (and not the depot_tools provided one), c++11, as well as libc++.

cheers,

Alex.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ff52ae8b-7e72-4fdc-b701-6a466b5a5b92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages