Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RKOTLIN-877] Avoid exporting Core's symbols to allow mixing multiple SDKs #1780

Merged
merged 8 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
-DREALM_ENABLE_SYNC=1 \
-DREALM_NO_TESTS=1 \
-DREALM_BUILD_LIB_ONLY=true \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
elle-j marked this conversation as resolved.
Show resolved Hide resolved
../../src/jvm
make -j8

Expand Down Expand Up @@ -213,6 +214,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Release `
-DREALM_ENABLE_SYNC=ON `
-DREALM_NO_TESTS=1 `
-DCMAKE_CXX_VISIBILITY_PRESET=hidden `
-DVCPKG_TARGET_TRIPLET=x64-windows-static
cmake --build . --config Release

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- None.

### Enhancements
- Avoid exporting Core's symbols so we can statically build the Kotlin SDK with other SDKs like Swift in the same project. (Issue [JIRA](https://jira.mongodb.org/browse/RKOTLIN-877)).
- Improved mechanism for unpacking of JVM native libs suitable for local development. (Issue [#1715](https://github.com/realm/realm-kotlin/issues/1715) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1065)).

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions packages/cinterop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ fun getSharedCMakeFlags(buildType: BuildType, ccache: Boolean = true): Array<Str
add("-DREALM_NO_TESTS=1")
add("-DREALM_BUILD_LIB_ONLY=true")
add("-DREALM_CORE_SUBMODULE_BUILD=true")
// This will prevent exporting Core's symbols which is useful when combining for example the Swift SDK and Kotlin Multiplatform
// in the same app. The generated dynamically linked shared Framework from Kotlin/Native can then be linked dynamically into the iOS app (!use_frameworks in Cocoapods)
// or statically. This will also reduce the binary size a little bit (avoid storing metadata about exported symbols)
add("-DCMAKE_CXX_VISIBILITY_PRESET=hidden")
}
return args.toTypedArray()
}
Expand Down
Loading