Skip to content

Commit

Permalink
Update to Core 13.23.1, Prepare 0.4.0 release (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
leemaguire authored Oct 19, 2023
1 parent ab2fc5f commit 4edf6f6
Show file tree
Hide file tree
Showing 18 changed files with 255 additions and 56 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- build-linux-sync
- build-linux-alpha
- build-macos-alpha
# - build-windows-sync
steps:
- uses: realm/ci-actions/mdb-realm/cleanup@30bd9ead57756016f2e2ac7630433cf0883d1bae
with:
Expand Down Expand Up @@ -534,6 +535,51 @@ jobs:
with:
timeout-minutes: 15

# build-windows-sync:
# runs-on: windows-2022
# name: Windows Sync ${{ matrix.configuration }}
# strategy:
# fail-fast: false
# matrix:
# configuration:
# - Debug
# - Release
# needs:
# - deploy-cluster
# env:
# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# submodules: 'recursive'
#
# - uses: ammaraskar/msvc-problem-matcher@master
#
# - name: Configure
# run: cmake --preset windows-x64
#
# - name: Compile
# run: cmake --build --preset windows-x64 --config ${{ matrix.configuration }}
#
# - name: Open a tmate debug session
# if: ${{ failure() && runner.debug }}
# uses: mxschmitt/action-tmate@v3
# with:
# timeout-minutes: 15
#
# - name: Test
# working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/
# run: ./cpprealm_sync_tests
#
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: always()
# with:
# report_paths: '.build/**/TestResults.xml'
# annotate_only: true
# require_tests: true

build-windows:
runs-on: windows-2022
name: Windows ${{ matrix.configuration }}
Expand Down
16 changes: 15 additions & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ license {
],
}

genrule {
name: "gen_realmcxx_version_numbers",
srcs: [
"dependencies.list",
"src/cpprealm/internal/version_numbers.hpp.in",
],
out: ["cpprealm/internal/version_numbers.hpp"],
tool_files: ["tools/generate-version-numbers-for-soong.sh"],
cmd: "$(location) $(in) > $(out)",
}


cc_defaults {
name: "realm_cpp_defaults",
cppflags: [
Expand All @@ -23,7 +35,8 @@ cc_defaults {
"-Wno-unused-function",
"-Wno-unused-local-typedef",
"-Wno-unused-variable"
]
],
generated_headers: ["gen_realmcxx_version_numbers"]
}

cc_library_static {
Expand All @@ -35,6 +48,7 @@ cc_library_static {
"src/cpprealm/internal/curl/**/*"
],
export_include_dirs: ["src"],
export_generated_headers: ["gen_realmcxx_version_numbers"],
static_libs: ["realm"],
include_build_directory: false
}
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
X.Y.Z Release notes (YYYY-MM-DD)
0.4.0 Release notes (2022-10-17)
=============================================================

### Fixed
* Primary keys could be changed after an object was inserted (since 0.1.0)
* Using a property type of vector of enums would cause a compilation error (since 0.1.0).
* Fixed a bug preventing SSL handshake from completing successfully due to failed hostname verification when linking against BoringSSL. (PR #7034)

### Enhancements
* The Sync metadata Realm is now encrypted by default on Apple platforms unless the `REALM_DISABLE_METADATA_ENCRYPTION` environment variable is set.
Expand All @@ -24,10 +25,10 @@ auto encrypted_app = realm::App(app_config);
use `realm::App(const realm::App::configuration&);` instead.
### Compatibility
* Fileformat: Generates files with format v22.
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
### Internals
* None
* Upgraded to Core v13.23.1
----------------------------------------------
Expand Down
45 changes: 28 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

project(realm)
project(RealmCxx)

if("$ENV{REALM_CI}" OR REALM_USE_CCACHE)
include(cmake/ccache.cmake)
Expand All @@ -15,25 +15,34 @@ else ()
endif()

set(REALM_BUILD_LIB_ONLY ON)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(REALM_USE_SYSTEM_OPENSSL ON)
set(OPENSSL_USE_STATIC_LIBS OFF)
endif()

add_subdirectory(realm-core)

set(REALM_INCLUDE_CERTS 0)
set(REALM_NO_CONFIG)
set(REALM_ENABLE_SYNC)
set(REALM_NO_TESTS)
set(REALM_BUILD_LIB_ONLY)
set(REALM_INSTALL_LIBEXECDIR)
set(REALM_ENABLE_ENCRYPTION 1)

list(APPEND CMAKE_MODULE_PATH
"${RealmCxx_SOURCE_DIR}/tools/cmake" # for GetVersion
"${RealmCxx_SOURCE_DIR}/realm-core/tools/cmake") # for GetGitRevisionDescription
if(NOT DEFINED REALMCXX_VERSION)
# Get accurate git-describe version
include(GetGitRevisionDescription)
git_describe(REALMCXX_VERSION)
endif()

add_compile_definitions(REALM_NO_CONFIG)
add_compile_definitions(REALM_ENABLE_SYNC)
add_compile_definitions(REALM_ENABLE_ENCRYPTION)
add_compile_definitions(REALM_INSTALL_LIBEXECDIR)
add_compile_definitions(REALM_BUILD_LIB_ONLY)
add_compile_definitions(REALM_VERSION_MAJOR=0)
add_compile_definitions(REALM_VERSION_MINOR=3)
add_compile_definitions(REALM_VERSION_PATCH=0)
add_compile_definitions(REALM_VERSION_STRING="0.3.0")

# Check if the compiler is Clang or GCC >= 11
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0"))
Expand All @@ -51,13 +60,11 @@ if(NOT APPLE AND NOT WINDOWS_STORE AND NOT ANDROID)
set(REALM_HAVE_UV 1)

option(REALM_FETCH_MISSING_DEPENDENCIES "Download missing dependencies with CMake's FetchContent where possible" ON)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/realm-core/tools/cmake")
if(REALM_FETCH_MISSING_DEPENDENCIES)
find_package(LibUV)
else()
find_package(LibUV REQUIRED)
endif()
list(POP_BACK CMAKE_MODULE_PATH)
if(LibUV_FOUND)
set(libuv_target LibUV::LibUV)
elseif(REALM_FETCH_MISSING_DEPENDENCIES)
Expand Down Expand Up @@ -102,18 +109,22 @@ elseif(ANDROID)
elseif(MSVC)
target_sources(cpprealm PRIVATE src/cpprealm/internal/network/network_transport.cpp)
else()
find_package(CURL REQUIRED)
target_link_libraries(cpprealm PUBLIC
CURL::libcurl stdc++fs
)
target_sources(cpprealm PRIVATE src/cpprealm/internal/curl/network_transport.cpp)
find_package(CURL)
if(NOT CURL_FOUND)
message(WARNING "CURL not found. Realm C++ will use internal networking components instead.")
target_sources(cpprealm PRIVATE src/cpprealm/internal/network/network_transport.cpp)
else()
target_link_libraries(cpprealm PUBLIC CURL::libcurl)
target_sources(cpprealm PRIVATE src/cpprealm/internal/curl/network_transport.cpp)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
target_link_libraries(cpprealm PRIVATE stdc++fs)
endif()
endif()

if(MSVC)
set_property(TARGET cpprealm PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET uv_a PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET cpprealm PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET uv_a PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

if (NOT REALM_CPP_NO_TESTS)
Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"inherits": "default",
"generator": "Visual Studio 17 2022",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "$env{vcpkg_arch}-windows"
"VCPKG_TARGET_TRIPLET": "$env{vcpkg_arch}-windows",
"REALM_INCLUDE_CERTS": "ON"
},
"condition": {
"lhs": "${hostSystemName}",
Expand Down
20 changes: 13 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,29 @@

import PackageDescription

let coreVersion = Version("13.23.1")

var cxxSettings: [CXXSetting] = [
.headerSearchPath("."),
.headerSearchPath("../"),
.define("REALM_ENABLE_SYNC", to: "1"),
.define("REALM_VERSION", to: "0.3.0"),

.define("REALM_DEBUG", .when(configuration: .debug)),
.define("REALM_NO_CONFIG"),
.define("REALM_INSTALL_LIBEXECDIR", to: ""),
.define("REALM_ENABLE_ASSERTIONS", to: "1"),
.define("REALM_ENABLE_ENCRYPTION", to: "1"),

.define("REALM_VERSION_MAJOR", to: "0"),
.define("REALM_VERSION_MINOR", to: "3"),
.define("REALM_VERSION_PATCH", to: "0"),
.define("REALM_VERSION_EXTRA", to: "\"\""),
.define("REALM_VERSION_STRING", to: "\"0.3.0\"")
.define("REALMCXX_VERSION_MAJOR", to: "0"),
.define("REALMCXX_VERSION_MINOR", to: "4"),
.define("REALMCXX_VERSION_PATCH", to: "0"),
.define("REALMCXX_VERSION_STRING", to: "\"0.4.0\""),
// Realm Core
.define("REALM_VERSION_MAJOR", to: String(coreVersion.major)),
.define("REALM_VERSION_MINOR", to: String(coreVersion.minor)),
.define("REALM_VERSION_PATCH", to: String(coreVersion.patch)),
.define("REALM_VERSION_EXTRA", to: "\"\(coreVersion.prereleaseIdentifiers.first ?? "")\""),
.define("REALM_VERSION_STRING", to: "\"\(coreVersion)\""),
]

let testCxxSettings: [CXXSetting] = cxxSettings + [
Expand Down Expand Up @@ -65,7 +71,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/realm/realm-core.git", revision: "eb34d4cb210b5e5374717c512ea910e3cb7d0bba")
.package(url: "https://github.com/realm/realm-core.git", revision: "c569bec4d04da84030d94f376437bc4efda3686b")
],
targets: [
cppSdkTarget,
Expand Down
1 change: 1 addition & 0 deletions dependencies.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION=0.4.0
2 changes: 1 addition & 1 deletion realm-core
Submodule realm-core updated 144 files
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
add_subdirectory(cpprealm/internal/bridge/generator)

include(GetVersion)
# Configure source code to use right version number
configure_file(${PROJECT_SOURCE_DIR}/src/cpprealm/internal/version_numbers.hpp.in ${PROJECT_SOURCE_DIR}/src/cpprealm/internal/version_numbers.hpp)
install(FILES version_numbers.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cpprealm
COMPONENT devel)

add_custom_command(
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/cpprealm/internal/bridge
-D BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/cpprealm/internal/bridge
Expand Down
Loading

0 comments on commit 4edf6f6

Please sign in to comment.