epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 1 | { |
| 2 | 'includes': [ |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 3 | 'common.gypi', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 4 | ], |
| 5 | 'targets': [ |
| 6 | # Due to an unfortunate intersection of lameness between gcc and gyp, |
| 7 | # we have to build the *_SSE2.cpp files in a separate target. The |
| 8 | # gcc lameness is that, in order to compile SSE2 intrinsics code, it |
| 9 | # must be passed the -msse2 flag. However, with this flag, it may |
| 10 | # emit SSE2 instructions even for scalar code, such as the CPUID |
| 11 | # test used to test for the presence of SSE2. So that, and all other |
| 12 | # code must be compiled *without* -msse2. The gyp lameness is that it |
| 13 | # does not allow file-specific CFLAGS, so we must create this extra |
| 14 | # target for those files to be compiled with -msse2. |
| 15 | # |
| 16 | # This is actually only a problem on 32-bit Linux (all Intel Macs have |
| 17 | # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit |
| 18 | # SSE2 from instrinsics, while generating plain ol' 386 for everything |
| 19 | # else). However, to keep the .gyp file simple and avoid platform-specific |
| 20 | # build breakage, we do this on all platforms. |
| 21 | |
| 22 | # For about the same reason, we need to compile the ARM opts files |
| 23 | # separately as well. |
| 24 | { |
| 25 | 'target_name': 'opts', |
| 26 | 'type': 'static_library', |
| 27 | 'include_dirs': [ |
| 28 | '../include/config', |
| 29 | '../include/core', |
| 30 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 31 | '../src/opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 32 | ], |
| 33 | 'conditions': [ |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 34 | [ 'skia_target_arch != "arm"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 35 | 'conditions': [ |
| 36 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
| 37 | 'cflags': [ |
| 38 | '-msse2', |
| 39 | ], |
| 40 | }], |
| 41 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 42 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 43 | '../src/opts/opts_check_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 44 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
| 45 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
| 46 | '../src/opts/SkUtils_opts_SSE2.cpp', |
| 47 | ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 48 | 'dependencies': [ |
| 49 | 'opts_ssse3', |
| 50 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 51 | }], |
| 52 | [ 'skia_target_arch == "arm" and armv7 == 1', { |
| 53 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 54 | # ARM), the compiler doesn't like that. |
| 55 | 'cflags!': [ |
| 56 | '-fno-omit-frame-pointer', |
| 57 | ], |
| 58 | 'cflags': [ |
| 59 | '-fomit-frame-pointer', |
| 60 | ], |
| 61 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 62 | '../src/opts/opts_check_arm.cpp', |
| 63 | '../src/opts/memset.arm.S', |
| 64 | '../src/opts/memset16_neon.S', |
| 65 | '../src/opts/memset32_neon.S', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 66 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 67 | '../src/opts/SkBlitRow_opts_arm.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 68 | ], |
| 69 | }], |
| 70 | [ 'skia_target_arch == "arm" and armv7 != 1', { |
| 71 | 'sources': [ |
| 72 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
| 73 | '../src/opts/SkBlitRow_opts_none.cpp', |
| 74 | '../src/opts/SkUtils_opts_none.cpp', |
| 75 | ], |
| 76 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 77 | ], |
| 78 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 79 | # For the same lame reasons as what is done for skia_opts, we have to |
| 80 | # create another target specifically for SSSE3 code as we would not want |
| 81 | # to compile the SSE2 code with -mssse3 which would potentially allow |
| 82 | # gcc to generate SSSE3 code. |
| 83 | { |
| 84 | 'target_name': 'opts_ssse3', |
| 85 | 'type': 'static_library', |
| 86 | 'include_dirs': [ |
| 87 | '../include/config', |
| 88 | '../include/core', |
| 89 | '../src/core', |
| 90 | ], |
| 91 | 'conditions': [ |
epoger@google.com | 2109923 | 2012-02-14 19:49:19 +0000 | [diff] [blame] | 92 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 93 | 'cflags': [ |
| 94 | '-mssse3', |
| 95 | ], |
| 96 | }], |
epoger@google.com | 2109923 | 2012-02-14 19:49:19 +0000 | [diff] [blame] | 97 | # TODO(epoger): the following will enable SSSE3 on Macs, but it will |
| 98 | # break once we set OTHER_CFLAGS anywhere else (the first setting will |
| 99 | # be replaced, not added to) |
| 100 | [ 'skia_os in ["mac"]', { |
| 101 | 'xcode_settings': { |
| 102 | 'OTHER_CFLAGS': ['-mssse3',], |
| 103 | }, |
| 104 | }], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 105 | [ 'skia_target_arch != "arm"', { |
| 106 | 'sources': [ |
| 107 | '../src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 108 | ], |
| 109 | }], |
| 110 | ], |
| 111 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 112 | ], |
| 113 | } |
| 114 | |
| 115 | # Local Variables: |
| 116 | # tab-width:2 |
| 117 | # indent-tabs-mode:nil |
| 118 | # End: |
| 119 | # vim: set expandtab tabstop=2 shiftwidth=2: |