1 # Gyp file for opts projects
4 # Due to an unfortunate intersection of lameness between gcc and gyp,
5 # we have to build the *_SSE2.cpp files in a separate target. The
6 # gcc lameness is that, in order to compile SSE2 intrinsics code, it
7 # must be passed the -msse2 flag. However, with this flag, it may
8 # emit SSE2 instructions even for scalar code, such as the CPUID
9 # test used to test for the presence of SSE2. So that, and all other
10 # code must be compiled *without* -msse2. The gyp lameness is that it
11 # does not allow file-specific CFLAGS, so we must create this extra
12 # target for those files to be compiled with -msse2.
14 # This is actually only a problem on 32-bit Linux (all Intel Macs have
15 # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
16 # SSE2 from instrinsics, while generating plain ol' 386 for everything
17 # else). However, to keep the .gyp file simple and avoid platform-specific
18 # build breakage, we do this on all platforms.
20 # For about the same reason, we need to compile the ARM opts files
23 'target_name': 'opts',
24 'product_name': 'skia_opts',
25 'type': 'static_library',
26 'standalone_static_library': 1,
36 [ 'skia_arch_type == "x86" and skia_os != "ios"', {
38 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', {
51 '../src/opts/opts_check_x86.cpp',
52 '../src/opts/SkBitmapProcState_opts_SSE2.cpp',
53 '../src/opts/SkBitmapFilter_opts_SSE2.cpp',
54 '../src/opts/SkBlitRow_opts_SSE2.cpp',
55 '../src/opts/SkBlitRect_opts_SSE2.cpp',
56 '../src/opts/SkBlurImage_opts_SSE2.cpp',
57 '../src/opts/SkMorphology_opts_SSE2.cpp',
58 '../src/opts/SkUtils_opts_SSE2.cpp',
59 '../src/opts/SkXfermode_opts_SSE2.cpp',
62 [ 'skia_arch_type == "arm" and arm_version >= 7', {
63 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
64 # ARM), the compiler doesn't like that.
66 '-fno-omit-frame-pointer',
71 '-fomit-frame-pointer',
75 'arm_neon_optional%': '<(arm_neon_optional>',
78 '../src/opts/memset.arm.S',
79 '../src/opts/SkBitmapProcState_opts_arm.cpp',
80 '../src/opts/SkBlitMask_opts_arm.cpp',
81 '../src/opts/SkBlitRow_opts_arm.cpp',
82 '../src/opts/SkBlitRow_opts_arm.h',
83 '../src/opts/SkBlurImage_opts_arm.cpp',
84 '../src/opts/SkMorphology_opts_arm.cpp',
85 '../src/opts/SkUtils_opts_arm.cpp',
86 '../src/opts/SkXfermode_opts_arm.cpp',
89 [ 'arm_neon == 1 or arm_neon_optional == 1', {
94 [ 'skia_os == "ios"', {
96 # these fail to compile under xcode for ios
97 '../src/opts/memset.arm.S',
98 '../src/opts/SkBitmapProcState_opts_arm.cpp',
99 '../src/opts/SkBlitRow_opts_arm.cpp',
104 [ '(skia_arch_type == "mips") or (skia_arch_type == "arm" and arm_version < 7) \
105 or (skia_os == "ios") \
106 or (skia_os == "android" and skia_arch_type not in ["x86", "arm", "mips", "arm64"])', {
108 '../src/opts/SkBitmapProcState_opts_none.cpp',
109 '../src/opts/SkBlitMask_opts_none.cpp',
110 '../src/opts/SkBlitRow_opts_none.cpp',
111 '../src/opts/SkBlurImage_opts_none.cpp',
112 '../src/opts/SkMorphology_opts_none.cpp',
113 '../src/opts/SkUtils_opts_none.cpp',
114 '../src/opts/SkXfermode_opts_none.cpp',
117 [ 'skia_android_framework', {
121 '-fomit-frame-pointer',
125 [ 'skia_arch_type == "arm64"', {
127 '../src/opts/SkBitmapProcState_arm_neon.cpp',
128 '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
129 '../src/opts/SkBitmapProcState_opts_arm.cpp',
130 '../src/opts/SkBlitMask_opts_arm.cpp',
131 '../src/opts/SkBlitMask_opts_arm_neon.cpp',
132 '../src/opts/SkBlitRow_opts_none.cpp',
133 '../src/opts/SkBlurImage_opts_arm.cpp',
134 '../src/opts/SkBlurImage_opts_neon.cpp',
135 '../src/opts/SkMorphology_opts_arm.cpp',
136 '../src/opts/SkMorphology_opts_neon.cpp',
137 '../src/opts/SkUtils_opts_none.cpp',
138 '../src/opts/SkXfermode_opts_arm.cpp',
139 '../src/opts/SkXfermode_opts_arm_neon.cpp',
144 # For the same lame reasons as what is done for skia_opts, we have to
145 # create another target specifically for SSSE3 code as we would not want
146 # to compile the SSE2 code with -mssse3 which would potentially allow
147 # gcc to generate SSSE3 code.
149 'target_name': 'opts_ssse3',
150 'product_name': 'skia_opts_ssse3',
151 'type': 'static_library',
152 'standalone_static_library': 1,
161 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"] \
162 and not skia_android_framework', {
167 # (Mac has -mssse3 globally.)
168 [ 'skia_arch_type == "x86"', {
170 '../src/opts/SkBitmapProcState_opts_SSSE3.cpp',
175 # NEON code must be compiled with -mfpu=neon which also affects scalar
176 # code. To support dynamic NEON code paths, we need to build all
177 # NEON-specific sources in a separate static library. The situation
178 # is very similar to the SSSE3 one.
180 'target_name': 'opts_neon',
181 'product_name': 'skia_opts_neon',
182 'type': 'static_library',
183 'standalone_static_library': 1,
193 '-fno-omit-frame-pointer',
194 '-mfpu=vfp', # remove them all, just in case.
199 [ 'not skia_android_framework', {
202 '-fomit-frame-pointer',
208 '-Wl,--fix-cortex-a8',
211 '../src/opts/memset16_neon.S',
212 '../src/opts/memset32_neon.S',
213 '../src/opts/SkBitmapProcState_arm_neon.cpp',
214 '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
215 '../src/opts/SkBitmapProcState_matrix_neon.h',
216 '../src/opts/SkBlitMask_opts_arm_neon.cpp',
217 '../src/opts/SkBlitRow_opts_arm_neon.cpp',
218 '../src/opts/SkBlurImage_opts_neon.cpp',
219 '../src/opts/SkMorphology_opts_neon.cpp',
220 '../src/opts/SkXfermode_opts_arm_neon.cpp',