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