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', |
| 31 | ], |
| 32 | 'conditions': [ |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 33 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 34 | 'cflags': [ |
| 35 | '-msse2', |
| 36 | ], |
| 37 | }], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 38 | [ 'skia_target_arch != "arm"', { |
| 39 | 'sources': [ |
| 40 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
| 41 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
| 42 | '../src/opts/SkUtils_opts_SSE2.cpp', |
| 43 | ], |
| 44 | }], |
| 45 | [ 'skia_target_arch == "arm" and armv7 == 1', { |
| 46 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 47 | # ARM), the compiler doesn't like that. |
| 48 | 'cflags!': [ |
| 49 | '-fno-omit-frame-pointer', |
| 50 | ], |
| 51 | 'cflags': [ |
| 52 | '-fomit-frame-pointer', |
| 53 | ], |
| 54 | 'sources': [ |
| 55 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 56 | '../src/opts/SkBlitRow_opts_arm.cpp', |
| 57 | '../src/opts/SkUtils_opts_none.cpp', |
| 58 | ], |
| 59 | }], |
| 60 | [ 'skia_target_arch == "arm" and armv7 != 1', { |
| 61 | 'sources': [ |
| 62 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
| 63 | '../src/opts/SkBlitRow_opts_none.cpp', |
| 64 | '../src/opts/SkUtils_opts_none.cpp', |
| 65 | ], |
| 66 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 67 | ], |
| 68 | }, |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | # Local Variables: |
| 73 | # tab-width:2 |
| 74 | # indent-tabs-mode:nil |
| 75 | # End: |
| 76 | # vim: set expandtab tabstop=2 shiftwidth=2: |