-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathPlatformCocoa.cmake
More file actions
354 lines (299 loc) · 13.2 KB
/
Copy pathPlatformCocoa.cmake
File metadata and controls
354 lines (299 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
add_definitions(-D__STDC_WANT_LIB_EXT1__)
target_compile_options(JavaScriptCore PRIVATE
"$<$<NOT:$<COMPILE_LANGUAGE:Swift>>:-fno-threadsafe-statics>"
)
find_library(SECURITY_LIBRARY Security)
find_library(COREGRAPHICS_LIBRARY CoreGraphics)
find_library(CORETEXT_LIBRARY CoreText)
list(APPEND JavaScriptCore_LIBRARIES
${SECURITY_LIBRARY}
${COREGRAPHICS_LIBRARY}
${CORETEXT_LIBRARY}
)
target_link_options(JavaScriptCore PRIVATE
"LINKER:-unexported_symbols_list,${JAVASCRIPTCORE_DIR}/unexported-libc++.txt"
)
list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES
"SourcesCocoa.txt"
"inspector/remote/SourcesCocoa.txt"
)
list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
${JAVASCRIPTCORE_DIR}/inspector/cocoa
${JAVASCRIPTCORE_DIR}/inspector/remote/cocoa
)
list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
inspector/remote/RemoteInspectorConstants.h
inspector/remote/cocoa/RemoteInspectorXPCConnection.h
)
# Headers Xcode marks Private but cmake omits from JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS.
list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
${JavaScriptCore_DERIVED_SOURCES_DIR}/AirOpcode.h
bytecode/DirectEvalCodeCacheInlines.h
runtime/FractionToDouble.h
wasm/WasmTypeSectionState.h
wasm/js/JSWebAssemblyStreamingContextInlines.h
)
list(REMOVE_ITEM JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
API/glib/JSAPIWrapperGlobalObject.h
API/glib/JSCAutocleanups.h
API/glib/JSCCallbackFunction.h
API/glib/JSCClassPrivate.h
API/glib/JSCContextInternal.h
API/glib/JSCContextPrivate.h
API/glib/JSCExceptionPrivate.h
API/glib/JSCGLibWrapperObject.h
API/glib/JSCOptions.h
API/glib/JSCValuePrivate.h
API/glib/JSCVirtualMachinePrivate.h
API/glib/JSCWrapperMap.h
)
list(REMOVE_ITEM JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
API/JSBase.h
API/JSCallbackConstructor.h
API/JSCallbackObject.h
API/JSContext.h
API/JSContextRef.h
API/JSExport.h
API/JSManagedValue.h
API/JSObjectRef.h
API/JSStringRef.h
API/JSStringRefCF.h
API/JSTypedArray.h
API/JSValue.h
API/JSValueRef.h
API/JSVirtualMachine.h
API/JavaScript.h
API/JavaScriptCore.h
)
list(REMOVE_ITEM JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
API/APICallbackFunction.h
b3/testb3.h
bytecode/BytecodeBasicBlock.h
bytecode/ChainedWatchpoint.h
bytecode/CodeBlockInlines.h
bytecode/InlineAccess.h
bytecode/MethodOfGettingAValueProfile.h
bytecode/TrackedReferences.h
dfg/DFGCPSRethreadingPhase.h
dfg/DFGCSEPhase.h
dfg/DFGInPlaceAbstractState.h
dfg/DFGLiveCatchVariablePreservationPhase.h
dfg/DFGRegisteredStructure.h
dfg/DFGRegisteredStructureSet.h
ftl/FTLAbbreviatedTypes.h
ftl/FTLCommonValues.h
ftl/FTLExitArgumentForOperand.h
ftl/FTLExitValue.h
ftl/FTLFormattedValue.h
ftl/FTLOSREntry.h
ftl/FTLStackmapArgumentList.h
ftl/FTLThunks.h
ftl/FTLValueFromBlock.h
ftl/FTLValueRange.h
jit/JITThunks.h
jit/SIMDShuffle.h
jit/SpillRegistersMode.h
llint/InPlaceInterpreter.h
llint/LLIntCLoop.h
llint/LLIntOfflineAsmConfig.h
llint/LLIntPCRanges.h
lol/LOLJIT.h
lol/LOLRegisterAllocator.h
profiler/ProfilerDumper.h
runtime/ArrayIteratorPrototype.h
runtime/BigInteger.h
runtime/IndexingTypeInlines.h
runtime/JSSetIteratorInlines.h
runtime/JSSourceCodeInlines.h
runtime/JSStringIteratorInlines.h
runtime/JSStringJoiner.h
runtime/MachineContext.h
runtime/ModuleGraphLoadingState.h
runtime/ModuleLoaderPayload.h
runtime/ModuleLoadingContext.h
runtime/ModuleRegistryEntry.h
runtime/RegExpInlines.h
runtime/RegExpMatchesArray.h
runtime/TemporalNow.h
wasm/WasmParser.h
wasm/WasmPlan.h
wasm/debugger/WasmBreakpointManager.h
wasm/debugger/WasmExecutionHandler.h
wasm/debugger/WasmMemoryHandler.h
wasm/debugger/WasmModuleManager.h
wasm/debugger/WasmQueryHandler.h
wasm/js/WebAssemblyPromising.h
wasm/js/WebAssemblySuspending.h
wasm/js/WebAssemblySuspendingConstructor.h
wasm/js/WebAssemblySuspendingPrototype.h
)
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/AugmentableInspectorControllerClient.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/AugmentableInspectorControllerClient.h "#include \"inspector/augmentable/AugmentableInspectorControllerClient.h\"")
endif ()
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorFrontendRouter.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorFrontendRouter.h "#include \"inspector/InspectorFrontendRouter.h\"")
endif ()
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.h "#include \"inspector/InspectorBackendDispatcher.h\"")
endif ()
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorBackendDispatchers.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorBackendDispatchers.h "#include \"inspector/InspectorBackendDispatchers.h\"")
endif ()
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorFrontendDispatchers.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorFrontendDispatchers.h "#include \"inspector/InspectorFrontendDispatchers.h\"")
endif ()
if (NOT EXISTS ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorProtocolObjects.h)
file(WRITE ${JavaScriptCore_DERIVED_SOURCES_DIR}/InspectorProtocolObjects.h "#include \"inspector/InspectorProtocolObjects.h\"")
endif ()
if (JavaScriptCore_INSTALL_NAME_DIR)
set_target_properties(JavaScriptCore PROPERTIES
INSTALL_NAME_DIR "${JavaScriptCore_INSTALL_NAME_DIR}"
)
endif ()
# iOS-family framework packaging (identity, versioning, Info.plist, and the
# private headers / module maps / sandbox profile the iOS framework ships).
if (WEBKIT_SDK_IS_IOS_FAMILY)
set(MACOSX_FRAMEWORK_IDENTIFIER com.apple.JavaScriptCore)
if (WTF_LIBRARY_TYPE STREQUAL "STATIC")
target_link_options(JavaScriptCore PRIVATE
"LINKER:-force_load,$<TARGET_FILE:WTF>"
)
endif ()
# BrowserEngineCore provides the inline-JIT-permissions API (be_memory_*)
# that threadSelfRestrict uses; weak-linked (iOS 17.4+).
target_link_options(JavaScriptCore PRIVATE "LINKER:-weak_framework,BrowserEngineCore")
target_compile_definitions(JavaScriptCore PRIVATE PAS_BMALLOC_HIDDEN=1)
target_compile_options(JavaScriptCore PRIVATE
"$<$<COMPILE_LANGUAGE:OBJC,OBJCXX>:-fvisibility=hidden>"
)
set(BUNDLE_VERSION "${MACOSX_FRAMEWORK_BUNDLE_VERSION}")
set(SHORT_VERSION_STRING "${WEBKIT_MAC_VERSION}")
set(PRODUCT_NAME "JavaScriptCore")
set(PRODUCT_BUNDLE_IDENTIFIER "com.apple.JavaScriptCore")
configure_file(${JAVASCRIPTCORE_DIR}/Info.plist ${CMAKE_CURRENT_BINARY_DIR}/JavaScriptCore-Info.plist)
set(JavaScriptCore_POST_BUILD_COMMAND
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/JavaScriptCore-Info.plist
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/JavaScriptCore.framework/Info.plist
)
# arm64e: MacroAssembler.h conditionally includes this via CPU(ARM64E).
list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
assembler/MacroAssemblerARM64E.h
heap/GCSegmentedArrayInlines.h
)
# Build-system scripts that ship as private framework headers.
list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
Scripts/UpdateContents.py
Scripts/cssmin.py
Scripts/generate-combined-inspector-json.py
Scripts/generate-js-builtins.py
Scripts/inline-and-minify-stylesheets-and-scripts.py
Scripts/jsmin.py
Scripts/lazywriter.py
Scripts/make-js-file-arrays.py
Scripts/xxd.pl
Scripts/wkbuiltins/builtins_generate_combined_header.py
Scripts/wkbuiltins/builtins_generate_combined_implementation.py
Scripts/wkbuiltins/builtins_generate_internals_wrapper_header.py
Scripts/wkbuiltins/builtins_generate_internals_wrapper_implementation.py
Scripts/wkbuiltins/builtins_generate_separate_header.py
Scripts/wkbuiltins/builtins_generate_separate_implementation.py
Scripts/wkbuiltins/builtins_generate_wrapper_header.py
Scripts/wkbuiltins/builtins_generate_wrapper_implementation.py
Scripts/wkbuiltins/builtins_generator.py
Scripts/wkbuiltins/builtins_model.py
Scripts/wkbuiltins/builtins_templates.py
Scripts/wkbuiltins/wkbuiltins.py
inspector/scripts/generate-inspector-protocol-bindings.py
inspector/scripts/codegen/cpp_generator.py
inspector/scripts/codegen/cpp_generator_templates.py
inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py
inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py
inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py
inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py
inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py
inspector/scripts/codegen/generate_cpp_protocol_types_header.py
inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
inspector/scripts/codegen/generate_js_backend_commands.py
inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py
inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py
inspector/scripts/codegen/generate_objc_configuration_header.py
inspector/scripts/codegen/generate_objc_configuration_implementation.py
inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py
inspector/scripts/codegen/generate_objc_header.py
inspector/scripts/codegen/generate_objc_internal_header.py
inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py
inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py
inspector/scripts/codegen/generate_objc_protocol_types_implementation.py
inspector/scripts/codegen/generator.py
inspector/scripts/codegen/generator_templates.py
inspector/scripts/codegen/models.py
inspector/scripts/codegen/objc_generator.py
inspector/scripts/codegen/objc_generator_templates.py
)
file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/JavaScriptCore.framework")
configure_file(${JAVASCRIPTCORE_DIR}/framework.sb ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/JavaScriptCore.framework/framework.sb COPYONLY)
configure_file(${JAVASCRIPTCORE_DIR}/JavaScriptCore.modulemap ${CMAKE_BINARY_DIR}/JavaScriptCore/Modules/module.modulemap COPYONLY)
configure_file("${JAVASCRIPTCORE_DIR}/JavaScriptCore_Private.modulemap" ${CMAKE_BINARY_DIR}/JavaScriptCore/Modules/module.private.modulemap COPYONLY)
endif ()
list(APPEND JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
API/JSCallbackFunction.h
API/JSContext.h
API/JSContextPrivate.h
API/JSContextRefPrivate.h
API/JSExport.h
API/JSManagedValue.h
API/JSStringRefCF.h
API/JSValue.h
API/JSValuePrivate.h
API/JSVirtualMachine.h
API/JavaScriptCore.h
)
# Private headers the JavaScriptCore_Private module map needs to parse.
list(APPEND JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
API/MARReportCrashPrivate.h
API/PASReportCrashPrivate.h
API/WorkAround173516139.h
assembler/MacroAssemblerPrinter.h
debugger/DebuggerEvalEnabler.h
disassembler/Disassembler.h
heap/CodeBlockSet.h
heap/ConservativeRoots.h
heap/GCIncomingRefCountedSetInlines.h
heap/HeapSnapshot.h
heap/JITStubRoutineSet.h
heap/VerifierSlotVisitorScope.h
heap/WriteBarrierSupport.h
inspector/augmentable/AlternateDispatchableAgent.h
inspector/augmentable/AugmentableInspectorController.h
jit/BinarySwitch.h
jit/ExecutableAllocationFuzz.h
jit/GdbJIT.h
jit/JITExceptions.h
jit/JSInterfaceJIT.h
parser/ModuleScopeData.h
runtime/PinballHandlerContext.h
tools/JSDollarVM.h
yarr/YarrJITRegisters.h
)
# Stage the module maps into the framework bundle so the Swift Clang importer
# finds JavaScriptCore / JavaScriptCore_Private as modules via -F. Otherwise
# <JavaScriptCore/*.h> is parsed textually and collides with other importers.
set(_jsc_modules_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/JavaScriptCore.framework/${WEBKIT_FRAMEWORK_VERSION_PATH}Modules")
add_custom_command(
OUTPUT "${_jsc_modules_dir}/module.modulemap"
COMMAND ${CMAKE_COMMAND} -E make_directory "${_jsc_modules_dir}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${JAVASCRIPTCORE_DIR}/JavaScriptCore.modulemap" "${_jsc_modules_dir}/module.modulemap"
MAIN_DEPENDENCY "${JAVASCRIPTCORE_DIR}/JavaScriptCore.modulemap"
VERBATIM)
add_custom_command(
OUTPUT "${_jsc_modules_dir}/module.private.modulemap"
COMMAND ${CMAKE_COMMAND} -E make_directory "${_jsc_modules_dir}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${JAVASCRIPTCORE_DIR}/JavaScriptCore_Private.modulemap" "${_jsc_modules_dir}/module.private.modulemap"
MAIN_DEPENDENCY "${JAVASCRIPTCORE_DIR}/JavaScriptCore_Private.modulemap"
VERBATIM)
add_custom_target(JavaScriptCore_CopyModules ALL DEPENDS
"${_jsc_modules_dir}/module.modulemap"
"${_jsc_modules_dir}/module.private.modulemap")
add_dependencies(JavaScriptCore JavaScriptCore_CopyModules)