diff options
author | David <ottodavid@gmx.net> | 2015-12-12 10:34:49 +0100 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2015-12-12 15:02:00 +0100 |
commit | 6b00ff6198210ac3f7e11d9758f4af1962961f1d (patch) | |
tree | c0805c49c95082b0a26f3baff56977c343c6e960 /wscript | |
parent | 162352419d423e69fcf5ea920a8763ce6fbcb0e7 (diff) |
Add option to use libc++ instead of libstdc++
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -389,20 +389,27 @@ int main() { return 0; }''', # compiler_flags.append ('-U__STRICT_ANSI__') + if opt.use_libcpp: + cxx_flags.append('--stdlib=libc++') + linker_flags.append('--stdlib=libc++') + if conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan' ]: conf.check_cxx(cxxflags=["-std=c++11"]) cxx_flags.append('-std=c++11') if platform == "darwin": - cxx_flags.append('--stdlib=libstdc++') # Mavericks and later changed the syntax to be used when including Carbon headers, # from requiring a full path to requiring just the header name. cxx_flags.append('-DCARBON_FLAT_HEADERS') - linker_flags.append('--stdlib=libstdc++') + + if not opt.use_libcpp: + cxx_flags.append('--stdlib=libstdc++') + linker_flags.append('--stdlib=libstdc++') # Prevents visibility issues in standard headers conf.define("_DARWIN_C_SOURCE", 1) else: cxx_flags.append('-DBOOST_NO_AUTO_PTR') + if (is_clang and platform == "darwin") or conf.env['build_host'] in ['mavericks', 'yosemite', 'el_capitan']: # Silence warnings about the non-existing osx clang compiler flags # -compatibility_version and -current_version. These are Waf @@ -728,6 +735,8 @@ def options(opt): help='Do not ask questions that require confirmation during the build') opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11', help='Turn on c++11 compiler flags (-std=c++11)') + opt.add_option('--use-libc++', action='store_true', default=False, dest='use_libcpp', + help='use libc++ instead of default or auto-detected stdlib') opt.add_option('--address-sanitizer', action='store_true', default=False, dest='asan', help='Turn on AddressSanitizer (requires GCC >= 4.8 or clang >= 3.1)') opt.add_option('--ptformat', action='store_true', default=False, dest='ptformat', |