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