2011-03-22 Eric Seidel <eric@webkit.org>
[WebKit-https.git] / Source / WebCore / gyp / WebCore.gyp
1 {
2   'includes': [
3     '../../gyp/common.gypi',
4     '../WebCore.gypi',
5   ],
6   'configurations': {
7     'Production': {
8       'xcode_config_file': '<(project_dir)/Configurations/Base.xcconfig',
9     },
10     'Release': {
11       'xcode_config_file': '<(project_dir)/Configurations/DebugRelease.xcconfig',
12       'xcode_settings': {
13         'STRIP_INSTALLED_PRODUCT': 'NO',
14       },
15     },
16     'Debug': {
17       'xcode_config_file': '<(project_dir)/Configurations/DebugRelease.xcconfig',
18       'xcode_settings': {
19         'DEAD_CODE_STRIPPING': '$(DEAD_CODE_STRIPPING_debug)',
20         'DEBUG_DEFINES': '$(DEBUG_DEFINES_debug)',
21         'GCC_OPTIMIZATION_LEVEL': '$(GCC_OPTIMIZATION_LEVEL_debug)',
22         'STRIP_INSTALLED_PRODUCT': '$(STRIP_INSTALLED_PRODUCT_debug)',
23       },
24     },
25   },
26   'targets': [
27     {
28       'target_name': 'WebCore',
29       'type': 'shared_library',
30       'dependencies': [
31         'Derived Sources',
32         'Update Version',
33         # FIXME: Add 'Copy Generated Headers',
34         # FIXME: Add 'Copy Forwarding and ICU Headers',
35         # FIXME: Add 'Copy Inspector Resources',
36       ],
37       'include_dirs': [
38         '<(project_dir)',
39         '<(project_dir)/icu',
40         '<(project_dir)/ForwardingHeaders',
41         '<(PRODUCT_DIR)/usr/local/include',
42         '/usr/include/libxml2',
43         '<(PRODUCT_DIR)/DerivedSources',
44         '<(PRODUCT_DIR)/DerivedSources/WebCore',
45       ],
46       'sources': [
47         '<@(webcore_files)',
48         '<@(webcore_privateheader_files)',
49         '<@(webcore_derived_source_files)',
50         '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
51         '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
52         '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
53         '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
54         '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
55         '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
56         '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
57         '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
58         '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
59         '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
60         '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
61         '<(PRODUCT_DIR)/JavaScriptCore.framework',
62         'libicucore.dylib',
63         'libobjc.dylib',
64         'libxml2.dylib',
65         'libz.dylib',
66       ],
67       'sources/': [
68         ['exclude', 'bindings/[^/]+/'],
69         ['include', 'bindings/generic/'],
70         ['include', 'bindings/js/'],
71         ['include', 'bindings/objc/'],
72
73         # FIXME: This could should move to Source/ThirdParty.
74         ['exclude', 'thirdparty/'],
75
76         # FIXME: Figure out how to store these patterns in a variable.
77         ['exclude', '(android|brew|cairo|chromium|curl|efl|freetype|fftw|gstreamer|gtk|haiku|linux|mkl|openvg|pango|qt|skia|soup|symbian|texmap|iphone|v8|win|wince|wx)/'],
78         ['exclude', '(Android|Brew|Cairo|Curl|Chromium|Efl|Haiku|Gtk|Linux|OpenType|Qt|Safari|Soup|Symbian|V8|Win|WinCE|Wx)\\.(cpp|mm?)$'],
79         ['exclude', 'Chromium[^/]*\\.(cpp|mm?)$'],
80
81         ['exclude', 'platform/image-decoders/'],
82         ['exclude', 'platform/image-encoders/'],
83
84         ['exclude', 'bridge/testbindings\\.cpp$'], # Remove from GYPI?
85         ['exclude', 'bridge/testbindings\\.mm$'], # Remove from GYPI?
86         ['exclude', 'bridge/testqtbindings\\.cpp$'], # Remove from GYPI?
87         ['exclude', 'platform/KillRingNone\\.cpp$'],
88         ['exclude', 'platform/graphics/cg/FontPlatformData\\.h$'],
89         ['exclude', 'platform/graphics/gpu/LoopBlinnPathProcessor\\.(cpp|h)$'],
90         ['exclude', 'platform/graphics/gpu/LoopBlinnLocalTriangulator\\.(cpp|h)$'],
91         ['exclude', 'platform/graphics/gpu/LoopBlinnPathCache\\.(cpp|h)$'],
92         ['exclude', 'platform/graphics/gpu/LoopBlinnShader\\.(cpp|h)$'],
93         ['exclude', 'platform/graphics/gpu/LoopBlinnSolidFillShader\\.(cpp|h)$'],
94         # FIXME: Consider excluding GL as a suffix.
95         ['exclude', 'platform/graphics/ImageSource\\.cpp$'],
96         ['exclude', 'platform/graphics/opengl/TextureMapperGL\\.cpp$'],
97         ['exclude', 'platform/graphics/opentype/OpenTypeUtilities\\.(cpp|h)$'],
98         ['exclude', 'platform/posix/SharedBufferPOSIX\\.cpp$'],
99         ['exclude', 'platform/text/Hyphenation\\.cpp$'],
100         ['exclude', 'platform/text/LocalizedNumberICU\\.cpp$'],
101         ['exclude', 'platform/text/LocalizedNumberNone\\.cpp$'],
102         ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
103         ['exclude', 'plugins/PluginDataNone\\.cpp$'],
104         ['exclude', 'plugins/PluginDatabase\\.cpp$'],
105         ['exclude', 'plugins/PluginPackageNone\\.cpp$'],
106         ['exclude', 'plugins/PluginPackage\\.cpp$'],
107         ['exclude', 'plugins/PluginStream\\.cpp$'],
108         ['exclude', 'plugins/PluginView\\.cpp$'],
109         ['exclude', 'plugins/mac/PluginPackageMac\\.cpp$'],
110         ['exclude', 'plugins/mac/PluginViewMac\\.mm$'],
111         ['exclude', 'plugins/npapi\\.cpp$'],
112
113         # FIXME: Check whether we need to build these derived source files.
114         ['exclude', 'JSAbstractView\\.(cpp|h)'],
115         ['exclude', 'JSElementTimeControl\\.(cpp|h)'],
116         ['exclude', 'JSMathMLElementWrapperFactory\\.(cpp|h)'],
117         ['exclude', 'JSSVGExternalResourcesRequired\\.(cpp|h)'],
118         ['exclude', 'JSSVGFilterPrimitiveStandardAttributes\\.(cpp|h)'],
119         ['exclude', 'JSSVGFitToViewBox\\.(cpp|h)'],
120         ['exclude', 'JSSVGLangSpace\\.(cpp|h)'],
121         ['exclude', 'JSSVGLocatable\\.(cpp|h)'],
122         ['exclude', 'JSSVGStylable\\.(cpp|h)'],
123         ['exclude', 'JSSVGTests\\.(cpp|h)'],
124         ['exclude', 'JSSVGTransformable\\.(cpp|h)'],
125         ['exclude', 'JSSVGURIReference\\.(cpp|h)'],
126         ['exclude', 'JSSVGZoomAndPan\\.(cpp|h)'],
127         ['exclude', 'tokenizer\\.cpp'],
128
129         ['exclude', 'AllInOne\\.cpp$'],
130
131         ['exclude', 'rendering/svg/[^/]+\\.cpp'],
132         ['include', 'rendering/svg/RenderSVGAllInOne\\.cpp$'],
133       ],
134       'mac_framework_private_headers': [
135         '<@(webcore_privateheader_files)',
136       ],
137       'mac_bundle_resources': [
138         '<@(webcore_resource_files)',
139       ],
140       'xcode_config_file': '<(project_dir)/Configurations/WebCore.xcconfig',
141       'actions': [
142         {
143           'action_name': 'Copy Forwarding and ICU Headers',
144           'inputs': [],
145           'outputs': [],
146           'action': [
147             'sh', '<(project_dir)/gyp/copy-forwarding-and-icu-headers.sh'
148           ],
149         },
150         {
151           'action_name': 'Copy Inspector Resources',
152           'inputs': [],
153           'outputs': [],
154           'action': [
155             'sh', '<(project_dir)/gyp/copy-inspector-resources.sh'
156           ],
157         },
158         {
159           'action_name': 'Streamline Inspector Source',
160           'inputs': [],
161           'outputs': [],
162           'action': [
163             'sh', '<(project_dir)/gyp/streamline-inspector-source.sh'
164           ],
165         },
166       ],
167       # FIXME: A number of these actions aren't supposed to run if "${ACTION}" = "installhdrs"
168       'postbuilds': [
169         {
170           'postbuild_name': 'Check For Global Initializers',
171           'action': [
172             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-global-initializers'
173           ],
174         },
175         {
176           'postbuild_name': 'Check For Exit Time Destructors',
177           'action': [
178             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-exit-time-destructors'
179           ],
180         },
181         {
182           'postbuild_name': 'Check For Weak VTables and Externals',
183           'action': [
184             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-weak-vtables-and-externals'
185           ],
186         },
187         {
188           'postbuild_name': 'Check For Inappropriate Files in Framework',
189           'action': [
190             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-inappropriate-files-in-framework'
191           ],
192         },
193       ],
194       'conditions': [
195         ['OS=="mac"', {
196           'mac_bundle': 1,
197           'xcode_settings': {
198             # FIXME: Remove these overrides once WebCore.xcconfig is
199             # used only by this project.
200             'GCC_PREFIX_HEADER': '<(project_dir)/WebCorePrefix.h',
201             'INFOPLIST_FILE': '<(project_dir)/Info.plist',
202             'ALWAYS_SEARCH_USER_PATHS': 'NO',
203           },
204         }],
205       ],
206     },
207     {
208       'target_name': 'Derived Sources',
209       'type': 'none',
210       'dependencies': [
211         'WebCoreExportFileGenerator',
212       ],
213       'xcode_config_file': '<(project_dir)/Configurations/WebCore.xcconfig',
214       'actions': [{
215         'action_name': 'Generate Derived Sources',
216         'inputs': [],
217         'outputs': [],
218         'action': [
219           'sh', 'generate-derived-sources.sh',
220         ],
221       }],
222     },
223     {
224       'target_name': 'Update Version',
225       'type': 'none',
226       'actions': [{
227         'action_name': 'Update Info.plist with version information',
228         'inputs': [],
229          'outputs': [],
230          'action': [
231            'sh', '<(project_dir)/gyp/update-info-plist.sh', '<(project_dir)/Info.plist'
232           ]
233       }],
234     },
235     {
236       'target_name': 'WebCoreExportFileGenerator Generator',
237       'type': 'none',
238       'actions': [{
239         'action_name': 'Generate Export File Generator',
240         'inputs': [
241           '<(project_dir)/WebCore.exp.in',
242         ],
243         'outputs': [
244           '<@(export_file_generator_files)',
245         ],
246         'action': [
247           'sh', '<(project_dir)/gyp/generate-webcore-export-file-generator.sh',
248         ],
249       }],
250     },
251     {
252       'target_name': 'WebCoreExportFileGenerator',
253       'type': 'executable',
254       'dependencies': [
255         'WebCoreExportFileGenerator Generator',
256       ],
257       'include_dirs': [
258         '<(project_dir)/ForwardingHeaders',
259       ],
260       'xcode_config_file': '<(project_dir)/Configurations/WebCore.xcconfig',
261       'configurations': {
262         'Production': {
263             'EXPORTED_SYMBOLS_FILE': '',
264             'GCC_OPTIMIZATION_LEVEL': '0',
265             'INSTALL_PATH': '/usr/local/bin',
266             'OTHER_LDFLAGS': '',
267             'SKIP_INSTALL': 'YES',
268         },
269         'Release': {
270           'xcode_settings': {
271             'EXPORTED_SYMBOLS_FILE': '',
272             'GCC_OPTIMIZATION_LEVEL': '0',
273             'INSTALL_PATH': '/usr/local/bin',
274             'OTHER_LDFLAGS': '',
275             'SKIP_INSTALL': 'YES',
276           },
277         },
278         'Debug': {
279           'xcode_settings': {
280             'EXPORTED_SYMBOLS_FILE': '',
281             'GCC_OPTIMIZATION_LEVEL': '0',
282             'INSTALL_PATH': '/usr/local/bin',
283             'OTHER_LDFLAGS': '',
284             'SKIP_INSTALL': 'YES',
285           },
286         },
287       },
288       'sources': [
289         '<@(export_file_generator_files)',
290       ],
291       'conditions': [
292         ['OS=="mac"', {
293           'xcode_settings': {
294             # FIXME: Remove these overrides once WebCore.xcconfig is
295             # used only by this project.
296             'GCC_PREFIX_HEADER': '<(project_dir)/WebCorePrefix.h',
297             'INFOPLIST_FILE': '<(project_dir)/Info.plist',
298           },
299         }],
300       ],
301     },
302   ], # targets
303 }