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 1 commit
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 @@ -149,6 +149,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 @@ -218,6 +219,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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- None.

### Enhancements
- None.
- Avoid exporting Core's symbols so we can build statically Kotlin SDK with other SDKs like Swift in the same project [RKOTLIN-877](https://jira.mongodb.org/browse/RKOTLIN-877).
nhachicha marked this conversation as resolved.
Show resolved Hide resolved

### Fixed
- None.
Expand Down
5 changes: 5 additions & 0 deletions packages/cinterop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ 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 Swift SDK and Kotlin Multiplatform
nhachicha marked this conversation as resolved.
Show resolved Hide resolved
// 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)
// TODO update on Linux as well
nhachicha marked this conversation as resolved.
Show resolved Hide resolved
add("-DCMAKE_CXX_VISIBILITY_PRESET=hidden")
}
return args.toTypedArray()
}
Expand Down
Loading