blob: 1f67e006d22bcd7d4eb39bcf69fddcde11a1bddf [file] [log] [blame]
epoger@google.comae85aea2011-05-31 13:50:51 +00001{
2 'includes': [
epoger@google.com5351b372011-07-01 17:16:26 +00003 'common.gypi',
epoger@google.comae85aea2011-05-31 13:50:51 +00004 ],
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.coma44e6c62012-01-09 14:38:25 +000031 '../src/opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000032 ],
33 'conditions': [
epoger@google.com8846cb22011-07-01 20:20:07 +000034 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +000035 'cflags': [
36 '-msse2',
37 ],
38 }],
djsollen@google.com58629292011-11-03 13:08:29 +000039 [ 'skia_target_arch != "arm"', {
40 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000041 '../src/opts/opts_check_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000042 '../src/opts/SkBitmapProcState_opts_SSE2.cpp',
43 '../src/opts/SkBlitRow_opts_SSE2.cpp',
44 '../src/opts/SkUtils_opts_SSE2.cpp',
45 ],
46 }],
47 [ 'skia_target_arch == "arm" and armv7 == 1', {
48 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
49 # ARM), the compiler doesn't like that.
50 'cflags!': [
51 '-fno-omit-frame-pointer',
52 ],
53 'cflags': [
54 '-fomit-frame-pointer',
55 ],
56 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000057 '../src/opts/opts_check_arm.cpp',
58 '../src/opts/memset.arm.S',
59 '../src/opts/memset16_neon.S',
60 '../src/opts/memset32_neon.S',
djsollen@google.com58629292011-11-03 13:08:29 +000061 '../src/opts/SkBitmapProcState_opts_arm.cpp',
62 '../src/opts/SkBlitRow_opts_arm.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000063 ],
64 }],
65 [ 'skia_target_arch == "arm" and armv7 != 1', {
66 'sources': [
67 '../src/opts/SkBitmapProcState_opts_none.cpp',
68 '../src/opts/SkBlitRow_opts_none.cpp',
69 '../src/opts/SkUtils_opts_none.cpp',
70 ],
71 }],
epoger@google.comae85aea2011-05-31 13:50:51 +000072 ],
73 },
74 ],
75}
76
77# Local Variables:
78# tab-width:2
79# indent-tabs-mode:nil
80# End:
81# vim: set expandtab tabstop=2 shiftwidth=2: