You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CppInteroperability/GettingStartedWithC++Interop.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -34,12 +34,12 @@ module Cxx {
34
34
Add the C++ module to the include path and enable C++ interop:
35
35
- Navigate to your project directory
36
36
- In `Project` navigate to `Build Settings` -> `Swift Compiler`
37
-
- Under `Custom Flags` -> `Other Swift Flags` add`-Xfrontend -enable-cxx-interop`
37
+
- Under `Custom Flags` -> `Other Swift Flags` add`-Xfrontend -enable-experimental-cxx-interop`
38
38
- Under `Search Paths` -> `Import Paths` add your search path to the C++ module (i.e, `./ProjectName/Cxx`). Repeat this step in `Other Swift Flags`
39
39
40
40
```
41
41
//Add to Other Swift Flags and Import Paths respectively
42
-
-Xfrontend -enable-cxx-interop
42
+
-Xfrontend -enable-experimental-cxx-interop
43
43
-I./ProjectName/Cxx
44
44
```
45
45
@@ -88,7 +88,7 @@ After creating your Swift package project, follow the steps [Creating a Module t
88
88
- Swift code will be in `Sources/CxxInterop` called `main.swift`
89
89
- C++ source code follows the example shown in [Creating a Module to contain your C++ source code](#creating-a-module-to-contain-your-c-source-code)
90
90
- Under targets, add the name of your C++ module and the directory containing the Swift code as a target.
91
-
- In the target defining your Swift target, add a`dependencies` to the C++ Module, the `path`, `source`, and `swiftSettings` with `unsafeFlags` with the source to the C++ Module, and enable `-enable-cxx-interop`
91
+
- In the target defining your Swift target, add a`dependencies` to the C++ Module, the `path`, `source`, and `swiftSettings` with `unsafeFlags` with the source to the C++ Module, and enable `-enable-experimental-cxx-interop`
92
92
93
93
```
94
94
//In Package Manifest
@@ -118,7 +118,7 @@ let package = Package(
118
118
sources: [ "main.swift" ],
119
119
swiftSettings: [.unsafeFlags([
120
120
"-I", "Sources/Cxx",
121
-
"-Xfrontend", "-enable-cxx-interop",
121
+
"-Xfrontend", "-enable-experimental-cxx-interop",
122
122
])]
123
123
),
124
124
]
@@ -151,7 +151,7 @@ After creating your project follow the steps [Creating a Module to contain your
151
151
- Create a `CMakeLists.txt` file and configure for your project
152
152
- In`add_library` invoke `cxx-support` with the path to the C++ implementation file
153
153
- Add the `target_include_directories` with `cxx-support` and path to the C++ Module `${CMAKE_SOURCE_DIR}/Sources/Cxx`
154
-
- Add the `add_executable` to the specific files/directory you would like to generate source, with`SHELL:-Xfrontend -enable-cxx-interop`.
154
+
- Add the `add_executable` to the specific files/directory you would like to generate source, with`SHELL:-Xfrontend -enable-experimental-cxx-interop`.
155
155
- In the example below we will be following the file structure used in [Creating a Swift Package](#Creating-a-Swift-Package)
156
156
157
157
```
@@ -176,7 +176,7 @@ target_include_directories(cxx-support PUBLIC
Copy file name to clipboardExpand all lines: test/Interop/Cxx/class/inline-function-codegen/constructor-calls-function-from-nested-calls-execution.swift
0 commit comments