2011-03-22 Eric Seidel <eric@webkit.org>
[WebKit-https.git] / Source / JavaScriptCore / gyp / JavaScriptCore.gyp
1 {
2   'includes': [
3     '../../gyp/common.gypi',
4     '../JavaScriptCore.gypi',
5   ],
6   'configurations': {
7     'Production': {
8       'xcode_config_file': '<(project_dir)/Configurations/Base.xcconfig',
9     },
10     'Profiling': {
11       'xcode_config_file': '<(project_dir)/Configurations/DebugRelease.xcconfig',
12       'xcode_settings': {
13         'STRIP_INSTALLED_PRODUCT': 'NO',
14       },
15     },
16     'Release': {
17       'xcode_config_file': '<(project_dir)/Configurations/DebugRelease.xcconfig',
18       'xcode_settings': {
19         'STRIP_INSTALLED_PRODUCT': 'NO',
20       },
21     },
22     'Debug': {
23       'xcode_config_file': '<(project_dir)/Configurations/DebugRelease.xcconfig',
24       'xcode_settings': {
25         'DEAD_CODE_STRIPPING': '$(DEAD_CODE_STRIPPING_debug)',
26         'DEBUG_DEFINES': '$(DEBUG_DEFINES_debug)',
27         'GCC_OPTIMIZATION_LEVEL': '$(GCC_OPTIMIZATION_LEVEL_debug)',
28         'STRIP_INSTALLED_PRODUCT': '$(STRIP_INSTALLED_PRODUCT_debug)',
29       },
30     },
31   },
32   'variables': {
33     'javascriptcore_include_dirs': [
34       '<(project_dir)',
35       '<(project_dir)/icu',
36     ],
37   },
38   'target_defaults': {
39     'configurations': {
40       'Profiling': {},
41     },
42   },
43   'targets': [
44     {
45       'target_name': 'JavaScriptCore',
46       'type': 'shared_library',
47       'dependencies': [
48         'Derived Sources',
49         'Update Version',
50       ],
51       'include_dirs': [
52         '<@(javascriptcore_include_dirs)',
53         '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore',
54       ],
55       'configurations': {
56         'Production': {
57           'INSTALL_PATH': '$(BUILT_PRODUCTS_DIR)',
58         },
59       },
60       'sources': [
61         '<@(javascriptcore_files)',
62         '<@(javascriptcore_publicheader_files)',
63         '<@(javascriptcore_privateheader_files)',
64         '<@(javascriptcore_derived_source_files)',
65         '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
66         '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
67         '/usr/lib/libicucore.dylib',
68         '/usr/lib/libobjc.dylib',
69       ],
70       'mac_framework_headers': [
71         '<@(javascriptcore_publicheader_files)',
72       ],
73       'mac_framework_private_headers': [
74         '<@(javascriptcore_privateheader_files)',
75       ],
76       'xcode_config_file': '<(project_dir)/Configurations/JavaScriptCore.xcconfig',
77       'sources/': [
78         ['exclude', 'qt'],
79         ['exclude', 'os-win32'],
80         ['exclude', 'wtf/android'],
81         ['exclude', 'wtf/brew'],
82         ['exclude', 'wtf/efl'],
83         ['exclude', 'wtf/gtk'],
84         ['exclude', 'wtf/qt'],
85         ['exclude', 'wtf/haiku'],
86         ['exclude', 'API/tests'],
87         ['exclude', 'wtf/url'],
88         ['exclude', 'wtf/wince'],
89         ['exclude', 'wtf/wx'],
90         ['exclude', 'wtf/unicode/brew'],
91         ['exclude', 'wtf/unicode/wince'],
92         ['exclude', 'wtf/unicode/glib'],
93         ['exclude', 'wtf/unicode/qt4'],
94         ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'],
95         ['exclude', '(Default|Gtk|Chromium|None|Qt|Win|Wx|Symbian)\\.(cpp|mm|h)$'],
96         ['exclude', 'GCActivityCallback\.cpp'],
97         ['exclude', '.*BSTR.*$'],
98       ],
99       'postbuilds': [
100         {
101           'postbuild_name': 'Check For Global Initializers',
102           'action': [
103             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-global-initializers'
104           ],
105         },
106         {
107           'postbuild_name': 'Check For Exit Time Destructors',
108           'action': [
109             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-exit-time-destructors'
110           ],
111         },
112         {
113           'postbuild_name': 'Check For Weak VTables and Externals',
114           'action': [
115             'sh', '<(project_dir)/gyp/run-if-exists.sh', '<(DEPTH)/../Tools/Scripts/check-for-weak-vtables-and-externals'
116           ],
117         },
118       ],
119       'conditions': [
120         ['OS=="mac"', {
121           'mac_bundle': 1,
122           'xcode_settings': {
123             # FIXME: Remove these overrides once JavaScriptCore.xcconfig is
124             # used only by this project.
125             'GCC_PREFIX_HEADER': '<(project_dir)/JavaScriptCorePrefix.h',
126             'INFOPLIST_FILE': '<(project_dir)/Info.plist',
127           },
128         }],
129       ],
130     },
131     {
132       'target_name': 'Derived Sources',
133       'type': 'none',
134       'actions': [
135         {
136           'action_name': 'Generate Derived Sources',
137           'inputs': [],
138           'outputs': [
139             '<@(javascriptcore_derived_source_files)',
140           ],
141           'action': [
142             'sh', 'generate-derived-sources.sh'
143           ],
144         },
145         {
146           'action_name': 'Generate DTrace Header',
147           'inputs': [],
148            'outputs': [],
149            'action': [
150              'sh', '<(project_dir)/gyp/generate-dtrace-header.sh', '<(project_dir)'
151             ]
152         }
153       ],
154     },
155     {
156       'target_name': 'Update Version',
157       'type': 'none',
158       'actions': [{
159         'action_name': 'Update Info.plist with version information',
160         'inputs': [],
161          'outputs': [],
162          'action': [
163            'sh', '<(project_dir)/gyp/update-info-plist.sh', '<(project_dir)/Info.plist'
164           ]
165       }],
166     },
167     {
168       'target_name': 'minidom',
169       'type': 'executable',
170       'dependencies': [
171         'JavaScriptCore',
172       ],
173       # FIXME: We should use a header map instead of listing these explicitly.
174       'include_dirs': [
175         '<@(javascriptcore_include_dirs)',
176       ],
177       'sources': [
178         '<@(minidom_files)',
179         '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
180       ],
181       'copies': [{
182         'destination': '<(PRODUCT_DIR)',
183         'files': [
184           '<@(minidom_support_files)',
185         ],
186       }],
187     },
188     {
189       'target_name': 'testapi',
190       'type': 'executable',
191       'dependencies': [
192         'JavaScriptCore',
193       ],
194       # FIXME: We should use a header map instead of listing these explicitly.
195       'include_dirs': [
196         '<@(javascriptcore_include_dirs)',
197       ],
198       'sources': [
199         '<@(testapi_files)',
200         '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
201       ],
202       'copies': [{
203         'destination': '<(PRODUCT_DIR)',
204         'files': [
205           '<@(testapi_support_files)',
206         ],
207       }],
208     },
209     {
210       'target_name': 'jsc',
211       'type': 'executable',
212       'dependencies': [
213         'JavaScriptCore',
214       ],
215       # FIXME: We should use a header map instead of listing these explicitly.
216       'include_dirs': [
217         '<@(javascriptcore_include_dirs)',
218       ],
219       'configurations': {
220         'Production': {
221           'xcode_settings': {
222             'INSTALL_PATH': '$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/Resources',
223           },
224         },
225       },
226       'sources': [
227         '<@(jsc_files)',
228         '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
229         '/usr/lib/libedit.dylib',
230       ],
231     },
232   ], # targets
233 }