diff --git a/arch.gypi b/arch.gypi new file mode 100644 index 00000000000000..3bf67d9322d909 --- /dev/null +++ b/arch.gypi @@ -0,0 +1,53 @@ +{ + 'conditions': [ + [ 'target_arch=="ia32"', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ], + }], + [ 'target_arch=="x32"', { + 'cflags': [ '-mx32' ], + 'ldflags': [ '-mx32' ], + }], + [ 'target_arch=="x64"', { + 'cflags': [ '-m64' ], + 'ldflags': [ '-m64' ], + }], + [ 'target_arch=="ppc" and OS!="aix"', { + 'cflags': [ '-m32' ], + 'ldflags': [ '-m32' ], + }], + [ 'target_arch=="ppc64" and OS!="aix"', { + 'cflags': [ '-m64', '-mminimal-toc' ], + 'ldflags': [ '-m64' ], + }], + [ 'target_arch=="s390"', { + 'cflags': [ '-m31' ], + 'ldflags': [ '-m31' ], + }], + [ 'target_arch=="s390x"', { + 'cflags': [ '-m64' ], + 'ldflags': [ '-m64' ], + }], + [ 'OS=="solaris"', { + 'cflags': [ '-pthreads' ], + 'ldflags': [ '-pthreads' ], + 'cflags!': [ '-pthread' ], + 'ldflags!': [ '-pthread' ], + }], + [ 'OS=="aix"', { + 'conditions': [ + [ 'target_arch=="ppc"', { + 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], + }], + [ 'target_arch=="ppc64"', { + 'cflags': [ '-maix64' ], + 'ldflags': [ '-maix64' ], + }], + ], + 'ldflags!': [ '-rdynamic' ], + }], + [ 'OS=="android" and _toolset=="target"', { + 'libraries': [ '-llog' ], + }], + ], +} diff --git a/common.gypi b/common.gypi index 8da603d00f618e..0099f786845816 100644 --- a/common.gypi +++ b/common.gypi @@ -242,60 +242,14 @@ ['_type=="static_library"', { 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19 }], - ], - 'conditions': [ - [ 'target_arch=="ia32"', { - 'cflags': [ '-m32' ], - 'ldflags': [ '-m32' ], - }], - [ 'target_arch=="x32"', { - 'cflags': [ '-mx32' ], - 'ldflags': [ '-mx32' ], - }], - [ 'target_arch=="x64"', { - 'cflags': [ '-m64' ], - 'ldflags': [ '-m64' ], - }], - [ 'target_arch=="ppc" and OS!="aix"', { - 'cflags': [ '-m32' ], - 'ldflags': [ '-m32' ], - }], - [ 'target_arch=="ppc64" and OS!="aix"', { - 'cflags': [ '-m64', '-mminimal-toc' ], - 'ldflags': [ '-m64' ], - }], - [ 'target_arch=="s390"', { - 'cflags': [ '-m31' ], - 'ldflags': [ '-m31' ], + ['_toolset=="host"', { + 'includes': [ 'arch.gypi' ], }], - [ 'target_arch=="s390x"', { - 'cflags': [ '-m64' ], - 'ldflags': [ '-m64' ], - }], - [ 'OS=="solaris"', { - 'cflags': [ '-pthreads' ], - 'ldflags': [ '-pthreads' ], - 'cflags!': [ '-pthread' ], - 'ldflags!': [ '-pthread' ], - }], - [ 'OS=="aix"', { - 'conditions': [ - [ 'target_arch=="ppc"', { - 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], - }], - [ 'target_arch=="ppc64"', { - 'cflags': [ '-maix64' ], - 'ldflags': [ '-maix64' ], - }], - ], - 'ldflags!': [ '-rdynamic' ], + ['_toolset=="target"', { + 'includes': [ 'arch.gypi' ], }], ], }], - [ 'OS=="android"', { - 'defines': ['_GLIBCXX_USE_C99_MATH'], - 'libraries': [ '-llog' ], - }], ['OS=="mac"', { 'defines': ['_DARWIN_USE_64_BIT_INODE=1'], 'xcode_settings': {