File: generate-plain-cpp-swift-interop-header.sh

package info (click to toggle)
webkit2gtk 2.51.4-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 481,584 kB
  • sloc: cpp: 3,903,132; javascript: 198,251; ansic: 165,758; python: 51,432; asm: 21,819; ruby: 18,095; perl: 16,963; xml: 4,623; sh: 2,408; yacc: 2,356; java: 2,019; lex: 1,358; pascal: 372; makefile: 203
file content (29 lines) | stat: -rwxr-xr-x 1,448 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -e

# Swift/C++ interop generates a header file to be included in C++ code that provides
# definitions of types encountered in Swift.
# There's built-in Xcode functionality to generate this file.
# But we need to do it twice:
# - once, processing Swift code that pertains to objective-C[++] types to generate
#   a header for inclusion in objective-C++ code
# - once, processing only Swift code that does not involve objective-C[++] types,
#   to generate a header which can be safely included in pure C++ code.
# This shell script does the second thing. We use the built-in XCode action
# for the first.
# Working around:
# - rdar://152836730
# - rdar://158843666
# We will be able to remove this script entirely once these issues are fixed.
# Known deficiencies in thie script:
# - We do not attempt to provide all the #defines normally provided to C++ nor
#   the -Ds to Swift.
# - We do not provide a full include path.
# - There is no attempt at full dependency tracking (.d files etc.)
# This is mostly OK because right now the only header file included from Swift
# refers to only one other header.

xcrun swiftc -typecheck -emit-clang-header-path "${SCRIPT_OUTPUT_FILE_0}" "${SCRIPT_INPUT_FILE_1}" -DENABLE_SWIFT_DEMO_URI_SCHEME \
    -I${SRCROOT}/Modules/Internal -I${SRCROOT} -cxx-interoperability-mode=default -Xcc -std=c++2b -module-name WebKit \
    -sdk ${SDKROOT} \
    -F ${SDKROOT}/System/Library/PrivateFrameworks