xref: /third_party/node/deps/base64/base64.gyp (revision 1cb0ef41)
11cb0ef41Sopenharmony_ci{
21cb0ef41Sopenharmony_ci  'variables': {
31cb0ef41Sopenharmony_ci    'arm_fpu%': '',
41cb0ef41Sopenharmony_ci    'target_arch%': '',
51cb0ef41Sopenharmony_ci  },
61cb0ef41Sopenharmony_ci  'targets': [
71cb0ef41Sopenharmony_ci    {
81cb0ef41Sopenharmony_ci      'target_name': 'base64',
91cb0ef41Sopenharmony_ci      'type': 'static_library',
101cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
111cb0ef41Sopenharmony_ci      'direct_dependent_settings': {
121cb0ef41Sopenharmony_ci        'include_dirs': [ 'base64/include' ],
131cb0ef41Sopenharmony_ci        'defines': [ 'BASE64_STATIC_DEFINE' ],
141cb0ef41Sopenharmony_ci      },
151cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE' ],
161cb0ef41Sopenharmony_ci      'sources': [
171cb0ef41Sopenharmony_ci        'base64/include/libbase64.h',
181cb0ef41Sopenharmony_ci        'base64/lib/arch/generic/codec.c',
191cb0ef41Sopenharmony_ci        'base64/lib/tables/tables.c',
201cb0ef41Sopenharmony_ci        'base64/lib/codec_choose.c',
211cb0ef41Sopenharmony_ci        'base64/lib/codecs.h',
221cb0ef41Sopenharmony_ci        'base64/lib/lib.c',
231cb0ef41Sopenharmony_ci      ],
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci      'conditions': [
261cb0ef41Sopenharmony_ci        [ 'arm_fpu=="neon" and target_arch=="arm"', {
271cb0ef41Sopenharmony_ci          'defines': [ 'HAVE_NEON32=1' ],
281cb0ef41Sopenharmony_ci          'dependencies': [ 'base64_neon32' ],
291cb0ef41Sopenharmony_ci        }, {
301cb0ef41Sopenharmony_ci          'sources': [ 'base64/lib/arch/neon32/codec.c' ],
311cb0ef41Sopenharmony_ci        }],
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ci        # arm64 requires NEON, so it's safe to always use it
341cb0ef41Sopenharmony_ci        [ 'target_arch=="arm64"', {
351cb0ef41Sopenharmony_ci          'defines': [ 'HAVE_NEON64=1' ],
361cb0ef41Sopenharmony_ci          'dependencies': [ 'base64_neon64' ],
371cb0ef41Sopenharmony_ci        }, {
381cb0ef41Sopenharmony_ci          'sources': [ 'base64/lib/arch/neon64/codec.c' ],
391cb0ef41Sopenharmony_ci        }],
401cb0ef41Sopenharmony_ci
411cb0ef41Sopenharmony_ci        # Runtime detection will happen for x86 CPUs
421cb0ef41Sopenharmony_ci        [ 'target_arch in "ia32 x64 x32"', {
431cb0ef41Sopenharmony_ci          'defines': [
441cb0ef41Sopenharmony_ci            'HAVE_SSSE3=1',
451cb0ef41Sopenharmony_ci            'HAVE_SSE41=1',
461cb0ef41Sopenharmony_ci            'HAVE_SSE42=1',
471cb0ef41Sopenharmony_ci            'HAVE_AVX=1',
481cb0ef41Sopenharmony_ci            'HAVE_AVX2=1',
491cb0ef41Sopenharmony_ci            'HAVE_AVX512=1',
501cb0ef41Sopenharmony_ci          ],
511cb0ef41Sopenharmony_ci          'dependencies': [
521cb0ef41Sopenharmony_ci            'base64_ssse3',
531cb0ef41Sopenharmony_ci            'base64_sse41',
541cb0ef41Sopenharmony_ci            'base64_sse42',
551cb0ef41Sopenharmony_ci            'base64_avx',
561cb0ef41Sopenharmony_ci            'base64_avx2',
571cb0ef41Sopenharmony_ci            'base64_avx512',
581cb0ef41Sopenharmony_ci          ],
591cb0ef41Sopenharmony_ci        }, {
601cb0ef41Sopenharmony_ci          'sources': [
611cb0ef41Sopenharmony_ci            'base64/lib/arch/ssse3/codec.c',
621cb0ef41Sopenharmony_ci            'base64/lib/arch/sse41/codec.c',
631cb0ef41Sopenharmony_ci            'base64/lib/arch/sse42/codec.c',
641cb0ef41Sopenharmony_ci            'base64/lib/arch/avx/codec.c',
651cb0ef41Sopenharmony_ci            'base64/lib/arch/avx2/codec.c',
661cb0ef41Sopenharmony_ci            'base64/lib/arch/avx512/codec.c',
671cb0ef41Sopenharmony_ci          ],
681cb0ef41Sopenharmony_ci        }],
691cb0ef41Sopenharmony_ci      ],
701cb0ef41Sopenharmony_ci    },
711cb0ef41Sopenharmony_ci
721cb0ef41Sopenharmony_ci    {
731cb0ef41Sopenharmony_ci      'target_name': 'base64_ssse3',
741cb0ef41Sopenharmony_ci      'type': 'static_library',
751cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
761cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/ssse3/codec.c' ],
771cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSSE3=1' ],
781cb0ef41Sopenharmony_ci      'conditions': [
791cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
801cb0ef41Sopenharmony_ci          'cflags': [ '-mssse3' ],
811cb0ef41Sopenharmony_ci          'xcode_settings': {
821cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-mssse3' ]
831cb0ef41Sopenharmony_ci          },
841cb0ef41Sopenharmony_ci        }],
851cb0ef41Sopenharmony_ci      ],
861cb0ef41Sopenharmony_ci    },
871cb0ef41Sopenharmony_ci
881cb0ef41Sopenharmony_ci    {
891cb0ef41Sopenharmony_ci      'target_name': 'base64_sse41',
901cb0ef41Sopenharmony_ci      'type': 'static_library',
911cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
921cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/sse41/codec.c' ],
931cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSE41=1' ],
941cb0ef41Sopenharmony_ci      'conditions': [
951cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
961cb0ef41Sopenharmony_ci          'cflags': [ '-msse4.1' ],
971cb0ef41Sopenharmony_ci          'xcode_settings': {
981cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-msse4.1' ]
991cb0ef41Sopenharmony_ci          },
1001cb0ef41Sopenharmony_ci        }],
1011cb0ef41Sopenharmony_ci      ],
1021cb0ef41Sopenharmony_ci    },
1031cb0ef41Sopenharmony_ci
1041cb0ef41Sopenharmony_ci    {
1051cb0ef41Sopenharmony_ci      'target_name': 'base64_sse42',
1061cb0ef41Sopenharmony_ci      'type': 'static_library',
1071cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
1081cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/sse42/codec.c' ],
1091cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_SSE42=1' ],
1101cb0ef41Sopenharmony_ci      'conditions': [
1111cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
1121cb0ef41Sopenharmony_ci          'cflags': [ '-msse4.2' ],
1131cb0ef41Sopenharmony_ci          'xcode_settings': {
1141cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-msse4.2' ]
1151cb0ef41Sopenharmony_ci          },
1161cb0ef41Sopenharmony_ci        }],
1171cb0ef41Sopenharmony_ci      ],
1181cb0ef41Sopenharmony_ci    },
1191cb0ef41Sopenharmony_ci
1201cb0ef41Sopenharmony_ci    {
1211cb0ef41Sopenharmony_ci      'target_name': 'base64_avx',
1221cb0ef41Sopenharmony_ci      'type': 'static_library',
1231cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
1241cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/avx/codec.c' ],
1251cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX=1' ],
1261cb0ef41Sopenharmony_ci      'conditions': [
1271cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
1281cb0ef41Sopenharmony_ci          'cflags': [ '-mavx' ],
1291cb0ef41Sopenharmony_ci          'xcode_settings': {
1301cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-mavx' ]
1311cb0ef41Sopenharmony_ci          },
1321cb0ef41Sopenharmony_ci        }, {
1331cb0ef41Sopenharmony_ci          'msvs_settings': {
1341cb0ef41Sopenharmony_ci            'VCCLCompilerTool': {
1351cb0ef41Sopenharmony_ci              'AdditionalOptions': [
1361cb0ef41Sopenharmony_ci                '/arch:AVX'
1371cb0ef41Sopenharmony_ci              ],
1381cb0ef41Sopenharmony_ci            },
1391cb0ef41Sopenharmony_ci          },
1401cb0ef41Sopenharmony_ci        }],
1411cb0ef41Sopenharmony_ci      ],
1421cb0ef41Sopenharmony_ci    },
1431cb0ef41Sopenharmony_ci
1441cb0ef41Sopenharmony_ci    {
1451cb0ef41Sopenharmony_ci      'target_name': 'base64_avx2',
1461cb0ef41Sopenharmony_ci      'type': 'static_library',
1471cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
1481cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/avx2/codec.c' ],
1491cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX2=1' ],
1501cb0ef41Sopenharmony_ci      'conditions': [
1511cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
1521cb0ef41Sopenharmony_ci          'cflags': [ '-mavx2' ],
1531cb0ef41Sopenharmony_ci          'xcode_settings': {
1541cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-mavx2' ]
1551cb0ef41Sopenharmony_ci          },
1561cb0ef41Sopenharmony_ci        }, {
1571cb0ef41Sopenharmony_ci          'msvs_settings': {
1581cb0ef41Sopenharmony_ci            'VCCLCompilerTool': {
1591cb0ef41Sopenharmony_ci              'AdditionalOptions': [
1601cb0ef41Sopenharmony_ci                '/arch:AVX2'
1611cb0ef41Sopenharmony_ci              ],
1621cb0ef41Sopenharmony_ci            },
1631cb0ef41Sopenharmony_ci          },
1641cb0ef41Sopenharmony_ci        }],
1651cb0ef41Sopenharmony_ci      ],
1661cb0ef41Sopenharmony_ci    },
1671cb0ef41Sopenharmony_ci
1681cb0ef41Sopenharmony_ci    {
1691cb0ef41Sopenharmony_ci      'target_name': 'base64_avx512',
1701cb0ef41Sopenharmony_ci      'type': 'static_library',
1711cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
1721cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/avx512/codec.c' ],
1731cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_AVX512=1' ],
1741cb0ef41Sopenharmony_ci      'conditions': [
1751cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
1761cb0ef41Sopenharmony_ci          'cflags': [ '-mavx512vl', '-mavx512vbmi' ],
1771cb0ef41Sopenharmony_ci          'xcode_settings': {
1781cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-mavx512vl', '-mavx512vbmi' ]
1791cb0ef41Sopenharmony_ci          },
1801cb0ef41Sopenharmony_ci        }, {
1811cb0ef41Sopenharmony_ci          'msvs_settings': {
1821cb0ef41Sopenharmony_ci            'VCCLCompilerTool': {
1831cb0ef41Sopenharmony_ci              'AdditionalOptions': [
1841cb0ef41Sopenharmony_ci                '/arch:AVX512'
1851cb0ef41Sopenharmony_ci              ],
1861cb0ef41Sopenharmony_ci            },
1871cb0ef41Sopenharmony_ci          },
1881cb0ef41Sopenharmony_ci        }],
1891cb0ef41Sopenharmony_ci      ],
1901cb0ef41Sopenharmony_ci    },
1911cb0ef41Sopenharmony_ci
1921cb0ef41Sopenharmony_ci    {
1931cb0ef41Sopenharmony_ci      'target_name': 'base64_neon32',
1941cb0ef41Sopenharmony_ci      'type': 'static_library',
1951cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
1961cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/neon32/codec.c' ],
1971cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_NEON32=1' ],
1981cb0ef41Sopenharmony_ci      'conditions': [
1991cb0ef41Sopenharmony_ci        [ 'OS!="win"', {
2001cb0ef41Sopenharmony_ci          'cflags': [ '-mfpu=neon' ],
2011cb0ef41Sopenharmony_ci          'xcode_settings': {
2021cb0ef41Sopenharmony_ci            'OTHER_CFLAGS': [ '-mfpu=neon' ]
2031cb0ef41Sopenharmony_ci          },
2041cb0ef41Sopenharmony_ci        }],
2051cb0ef41Sopenharmony_ci      ],
2061cb0ef41Sopenharmony_ci    },
2071cb0ef41Sopenharmony_ci
2081cb0ef41Sopenharmony_ci    {
2091cb0ef41Sopenharmony_ci      'target_name': 'base64_neon64',
2101cb0ef41Sopenharmony_ci      'type': 'static_library',
2111cb0ef41Sopenharmony_ci      'include_dirs': [ 'base64/include', 'base64/lib' ],
2121cb0ef41Sopenharmony_ci      'sources': [ 'base64/lib/arch/neon64/codec.c' ],
2131cb0ef41Sopenharmony_ci      'defines': [ 'BASE64_STATIC_DEFINE', 'HAVE_NEON64=1' ],
2141cb0ef41Sopenharmony_ci      # NEON is required in arm64, so no -mfpu flag is needed
2151cb0ef41Sopenharmony_ci    }
2161cb0ef41Sopenharmony_ci
2171cb0ef41Sopenharmony_ci  ]
2181cb0ef41Sopenharmony_ci}
219