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
- On a Mac Studio M2 Ultra, this takes a little more than a minute while on an 8-Core Intel Xeon iMac Pro, it takes around 3 minutes. So it might be worth getting some coffee depending on your hardware. (TODO: Outdated info, as now with parallel building support the times are way better)
112
112
- The individual code generation and builds steps are shown in the terminal.
113
-
- The last printed line should include the path where the build output has been written to (ie. `Build Output has been written to "/Path/To/BeyondDemo/bin/Release/net9.0/publish"`).
114
-
- Check the contents of the build output path: `ls bin/Release/net9.0/publish`
113
+
- The last printed line should include the path where the build output has been written to (ie. `Build Output has been written to "/Path/To/BeyondDemo/bin/Release/publish"`).
114
+
- Check the contents of the build output path: `ls bin/Release/publish`
115
115
- It should include an XCFramework bundle called `BeyondDemoKit.xcframework`.
116
116
- Congratulations, you now have a fully functional native version of your .NET library that can be consumed by macOS and iOS Xcode projects.
117
117
@@ -131,7 +131,7 @@ Now that we have an XCFramework containing binaries for macOS and iOS, we can in
131
131
- Select the `General` tab.
132
132
- Under `Frameworks, Libraries and Embedded Content`, click the `+` button.
133
133
- Select `Add Other... - Add Files...`.
134
-
- Navigate one level up in the file picker, then go to `bin/Release/net9.0/publish` (depending on your output path).
134
+
- Navigate one level up in the file picker, then go to `bin/Release/publish` (depending on your output path).
135
135
- Select `BeyondDemoKit.xcframework`.
136
136
- The XCFramework should now show up and it should already be configured to `Embed & Sign`.
137
137
- Select `ContentView.swift` in the project navigator.
Copy file name to clipboardexpand all lines: README_MANUAL_BUILD.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
- Also, the install name of dylibs created by .NET's NativeAOT compiler needs to adjusted from `/usr/lib/MyLibNative.dylib` to `@rpath/MyLibNative.dylib`.
14
14
- There's a sample publish script which does all of this in the repository called `publish_macos_universal`. You can use this as the basis for your build. Just make sure to adjust the `OUTPUT_PRODUCT_NAME` variable to match the assembly name of your .NET library (`MyLib`).
15
15
- Run the publish script (ie. `./publish_macos_universal`).
16
-
- On macOS this will produce a universal `MyNativeLib.dylib` in the bin directory under `bin/Release/net9.0/osx-universal/publish`.
16
+
- On macOS this will produce a universal `MyNativeLib.dylib` in the bin directory under `bin/Release/osx-universal/publish`.
17
17
18
18
19
19
### Use generated bindings from Swift
@@ -27,7 +27,7 @@
27
27
- Select "Add other... - Add files..." and select the native dylib (ie. `MyNativeLib.dylib`)
28
28
- Try to build the project. If it fails, you might need to adjust either your header or library search paths in the project settings.
29
29
- If Xcode fails to link the native dylib (the error looks something like this: `Library not found for -lMyNativeLib`) you need to adjust "Build Settings - Library Search Paths" in you project settings to point to the path where the library is located.
30
-
- For example, if the native library is located one level below your Xcode project in a folder called "MyLibNative/bin/Release/net9.0/osx-universal/publish" use this: `$(PROJECT_DIR)/../MyLibNative/bin/Release/net9.0/osx-universal/publish`)
30
+
- For example, if the native library is located one level below your Xcode project in a folder called "MyLibNative/bin/Release/osx-universal/publish" use this: `$(PROJECT_DIR)/../MyLibNative/bin/Release/osx-universal/publish`)
31
31
- If Xcode complains about being unable to find the generated C header, adjust "Build Settings - Header Search Paths" to point to the path where the generated header is located.
32
32
- For example, if your header is one level below your Xcode project in a folder called "Generated" use this: `$(PROJECT_DIR)/../Generated`
33
33
- You're now ready to call any of the APIs that bindings were generated for.
0 commit comments