Chromium Code Reviews| Index: build/common.gypi |
| diff --git a/build/common.gypi b/build/common.gypi |
| index e7dc6170c65224e50ad30471968433c0cf10f690..67547d63f754ebb9e25e3e0f612473f7c891a7ed 100644 |
| --- a/build/common.gypi |
| +++ b/build/common.gypi |
| @@ -5256,6 +5256,26 @@ |
| }, # configuration "Release" |
| }, # configurations |
| 'xcode_settings': { |
| + # Tell the compiler to use libc++'s headers and the linker to link |
| + # against libc++. The latter part normally requires OS X 10.7, but |
| + # we still support running on 10.6. How does this work? Two parts: |
| + # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6 |
| + # combined with -stdlib=libc++ (it normally silently produced a |
| + # binary that doesn't run on 10.6) |
|
Mark Mentovai
2015/10/23 13:56:36
Is this a local change that we’ve made to clang, o
Nico
2015/10/23 15:39:29
That's a local change Apple has in their branch. W
|
| + # 2. Further down, library_dirs is set to third_party/libc++-static, |
| + # which contains a static libc++.a library. The linker then links |
| + # against that instead of again /usr/lib/libc++.dylib when it sees |
|
Mark Mentovai
2015/10/23 13:56:36
again → against
Nico
2015/10/23 15:39:29
Done.
|
| + # the -lc++ flag added by the driver. |
| + # |
| + # In component builds, just link to the system libc++. |
| + # This has the effect of making everything depend on libc++, which |
| + # means component-build binaries won't run on 10.6 (no libc++ there), |
| + # but for a developer-only configuration that's ok. (We don't want |
| + # to raise the deployment target yet so that official and dev builds |
| + # have the same deployment target. This affects things like which |
| + # functions are considered deprecated.) |
| + 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ |
| + |
| 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic |
| # (Equivalent to -fPIC) |
| # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min |
| @@ -5272,23 +5292,15 @@ |
| # specified or not. |
| '-fno-strict-aliasing', # See http://crbug.com/32204. |
| ], |
| - 'conditions': [ |
| - ['component=="shared_library"', { |
| - # In component builds, link to the system libc++. This requires |
| - # OS X 10.7, but we currently pass -mmacosx-version-min=10.6. |
| - # Xcode's clang complains about this, but our open-source bundled |
| - # chromium clang doesn't. This has the effect of making |
| - # everything depend on libc++, which means component-build |
| - # binaries won't run on 10.6 (no libc++ there), but for a |
| - # developer-only configuration that's ok. |
| - # (We don't want to raise the deployment target yet so that |
| - # official and dev builds have the same deployment target. This |
| - # affects things like which functions are considered deprecated.) |
| - 'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++ |
| - }], |
| - ], |
| }, |
| 'target_conditions': [ |
| + ['>(nacl_untrusted_build)==0 and component=="static_library"', { |
| + # See the comment for CLANG_CXX_LIBRARY above for what this does. |
| + # The NaCl toolchains have their own toolchain and don't need this. |
| + 'library_dirs': [ |
| + '<(DEPTH)/third_party/libc++-static', |
|
Nico
2015/10/23 13:05:33
The alternative here would be to use clang instead
Mark Mentovai
2015/10/23 13:56:36
Nico (vacation Fri Oct 23) wrote:
|
| + ], |
| + }], |
| ['_type=="executable"', { |
| 'postbuilds': [ |
| { |