Skip to content

Commit ae135a5

Browse files
committed
Version 4.0.2
1 parent da2be14 commit ae135a5

34 files changed

+1398
-61
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
ObjectBox C and C++ API Changelog
22
=================================
33

4+
4.0.2 (2024-10-15)
5+
------------------
6+
* Made closing the store more robust; e.g. it waits for ongoing queries and transactions to finish
7+
(please still ensure to clean up properly on your side, this is an additional safety net)
8+
* Made Box API more robust when racing against store closing
9+
* Improved C++ APIs for nearest neighbor search (query building etc.)
10+
* Some minor HNSW performance improvements
11+
* Add "vectorsearch-cities" example
12+
13+
### Sync
14+
15+
* Fixed a serious regression; please update to the latest version asap!
16+
* Added a special compression for tiny transactions
17+
* Embedded clusters (note: the cluster feature may not come with all editions of the library)
18+
* Add FlatBuffers based configuration for Sync Server
19+
420
4.0.1 (2024-07-17)
521
------------------
622
* Query: "visit with score" added, so you can consume vector search results one-by-one with a visitor callback

CMakeLists.txt

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.5)
22
# 3.5: Since CMake 3.27 VERSION < 3.5 produce a deprecation warning.
33

4-
project(ObjectBoxCRoot) # to be displayed in an IDE when this CMake is opened
4+
# This CMake file has the following purposes:
5+
# * Define the ObjectBox library target (target name "objectbox"; or, if the sync variant is used, "objectbox-sync")
6+
# * Fetch (download) the ObjectBoxGenerator CMake
7+
# * Unless this CMake is consumed from a user project, add the sub-projects (tests and examples)
8+
#
9+
# Options are available via plain (not cached) variables that can be declared before fetching this CMake module:
10+
# * ObjectBoxGenerator_CMAKE_DISABLE: set to ON to skip CMake integration of ObjectBox Generator
11+
# * ObjectBoxGenerator_CMAKE_VERSION: override the default version of the ObjectBox Generator CMake.
12+
# Changes the version to be fetched (git tag or branch).
13+
14+
project(ObjectBoxCRoot)
515

616
# Remove Warning (as of CMake >= 3.24):
717
# "The DOWNLOAD_EXTRACT_TIMESTAMP option was not given.."
818
# We use the new behaviour (file timestamps from downloaded/extracted archives are updated).
9-
if(POLICY CMP0135)
19+
if (POLICY CMP0135)
1020
cmake_policy(SET CMP0135 NEW)
11-
endif()
21+
endif ()
1222

1323
if (${CMAKE_VERSION} VERSION_LESS "3.11.0")
1424
message("Please consider upgrading your CMake to a more recent version (v3.11+) to get automatic library download.")
@@ -39,7 +49,7 @@ else ()
3949

4050
function(defineObjectBoxLib VARIANT)
4151
# Configuration updated for each release
42-
set(DL_VERSION 4.0.1)
52+
set(DL_VERSION 4.0.2)
4353

4454
# Platform detection and other setup
4555
set(DL_URL https://github.com/objectbox/objectbox-c/releases/download)
@@ -84,8 +94,56 @@ else ()
8494
endif ()
8595
endif ()
8696

87-
# By default we exclude tests and examples.
88-
# If you want to build them please "make" them explicitly by target name (see targets below)
89-
add_subdirectory(src-test EXCLUDE_FROM_ALL) # target: objectbox-c-test
90-
add_subdirectory(src-test-gen EXCLUDE_FROM_ALL) # target: objectbox-c-gen-test
91-
add_subdirectory(examples EXCLUDE_FROM_ALL) # targets: objectbox-c-examples-tasks-{c,cpp-gen,cpp-gen-sync}
97+
# ObjectBoxGenerator CMake Downloader
98+
# -----------------------------------
99+
# Make "FindObjectBoxGenerator" available, which is used to download/find and run the ObjectBox Generator.
100+
101+
if (ObjectBoxGenerator_CMAKE_DISABLE)
102+
message(STATUS "ObjectBox Generator: CMake integration disabled")
103+
else ()
104+
if(NOT DEFINED ObjectBoxGenerator_CMAKE_VERSION OR ObjectBoxGenerator_CMAKE_VERSION STREQUAL "")
105+
# The default version is a specific version that "matches" the ObjectBox library version of this repo.
106+
# Nevertheless, it's often possible to use a newer Generator version as breaking changes are infrequent.
107+
set(ObjectBoxGenerator_CMAKE_VERSION "v4.0.0-beta")
108+
endif ()
109+
set(OBX_GEN_DL_URL https://raw.githubusercontent.com/objectbox/objectbox-generator/${ObjectBoxGenerator_CMAKE_VERSION}/cmake/FindObjectBoxGenerator.cmake)
110+
111+
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
112+
message(STATUS "ObjectBox Generator: fetching version \"${ObjectBoxGenerator_CMAKE_VERSION}\"")
113+
include(FetchContent)
114+
FetchContent_Declare(FindObjectBoxGenerator URL ${OBX_GEN_DL_URL} DOWNLOAD_NO_EXTRACT TRUE)
115+
FetchContent_MakeAvailable(FindObjectBoxGenerator)
116+
set(OBX_GEN_MODULE_DIR ${findobjectboxgenerator_SOURCE_DIR})
117+
else ()
118+
message(STATUS "ObjectBox Generator: fetching version \"${ObjectBoxGenerator_CMAKE_VERSION}\" (using old CMake version)")
119+
set(OBX_GEN_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake)
120+
file(MAKE_DIRECTORY ${OBX_GEN_MODULE_DIR})
121+
if (NOT EXISTS ${OBX_GEN_MODULE_DIR}/FindObjectBoxGenerator.cmake)
122+
file(DOWNLOAD ${OBX_GEN_DL_URL} ${OBX_GEN_MODULE_DIR}/FindObjectBoxGenerator.cmake
123+
TLS_VERIFY ON
124+
STATUS DL_STATUS
125+
)
126+
if (NOT DL_STATUS EQUAL 0)
127+
message(WARNING "Downloading FindObjectBoxGenerator.cmake from URL ${DL_URL} failed")
128+
endif ()
129+
endif ()
130+
endif ()
131+
132+
if (EXISTS ${OBX_GEN_MODULE_DIR}/FindObjectBoxGenerator.cmake)
133+
# Enable find_package to locate ObjectBoxGenerator find module.
134+
list(APPEND CMAKE_MODULE_PATH ${OBX_GEN_MODULE_DIR})
135+
get_directory_property(hasParent PARENT_DIRECTORY)
136+
if (hasParent)
137+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)
138+
endif ()
139+
endif ()
140+
endif ()
141+
142+
143+
# If this project is top-level, include public tests and examples.
144+
# Otherwise, this CMake file is used from a user project, so we do not want to expose these.
145+
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
146+
add_subdirectory(src-test) # target: objectbox-c-test
147+
add_subdirectory(src-test-gen) # target: objectbox-c-gen-test
148+
add_subdirectory(examples) # targets: objectbox-c-examples-tasks-{c,cpp-{auto}gen,cpp-gen-sync}
149+
endif ()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ box.put({.text = "Buy milk"});
1818
1919
See [ObjectBox C and C++ docs](https://cpp.objectbox.io/) for API details.
2020
21-
**Latest version: 4.0.1** (2024-07-17).
21+
**Latest version: 4.0.2** (2024-10-15).
2222
See [changelog](CHANGELOG.md) for more details.
2323
2424
## Table of Contents:

download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tty -s || quiet=true
4444

4545
# Note: optional arguments like "--quiet" shifts argument positions in the case block above
4646

47-
version=${1:-4.0.1}
47+
version=${1:-4.0.2}
4848
os=${2:-$(uname)}
4949
arch=${3:-$(uname -m)}
5050
echo "Base config: OS ${os} and architecture ${arch}"

doxygen/Changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
ObjectBox C and C++ API Changelog
44
=================================
55

6+
4.0.2 (2024-10-15)
7+
------------------
8+
* Made closing the store more robust; e.g. it waits for ongoing queries and transactions to finish
9+
(please still ensure to clean up properly on your side, this is an additional safety net)
10+
* Made Box API more robust when racing against store closing
11+
* Improved C++ APIs for nearest neighbor search (query building etc.)
12+
* Some minor HNSW performance improvements
13+
* Add "vectorsearch-cities" example
14+
15+
### Sync
16+
17+
* Fixed a serious regression; please update to the latest version asap!
18+
* Added a special compression for tiny transactions
19+
* Embedded clusters (note: the cluster feature may not come with all editions of the library)
20+
* Add FlatBuffers based configuration for Sync Server
21+
622
4.0.1 (2024-07-17)
723
------------------
824
* Query: "visit with score" added, so you can consume vector search results one-by-one with a visitor callback

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "ObjectBox C and C++ API"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "4.0.1"
41+
PROJECT_NUMBER = "4.0.2"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

examples/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
add_subdirectory(c-cursor-no-gen)
22
add_subdirectory(c-gen)
33
add_subdirectory(cpp-gen)
4-
add_subdirectory(cpp-gen-sync)
4+
add_subdirectory(cpp-gen-sync)
5+
6+
find_package(ObjectBoxGenerator 4.0.0)
7+
# Some platforms such as Linux ARM(64) and Windows ARM(64) are not supported.
8+
# We exclude this example for these cases where the generator was not found.
9+
if (ObjectBoxGenerator_FOUND)
10+
add_subdirectory(cpp-autogen)
11+
else ()
12+
message(WARNING "Did not add all examples, as the ObjectBoxGenerator CMake was not found")
13+
endif ()
14+
add_subdirectory(vectorsearch-cities)

examples/c-cursor-no-gen/flatbuffers_common_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef FLATBUFFERS_COMMON_BUILDER_H
22
#define FLATBUFFERS_COMMON_BUILDER_H
33

4-
/* Generated by flatcc 0.6.1-dev FlatBuffers schema compiler for C by dvide.com */
4+
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
55

66
/* Common FlatBuffers build functionality for C. */
77

examples/c-cursor-no-gen/flatbuffers_common_reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef FLATBUFFERS_COMMON_READER_H
22
#define FLATBUFFERS_COMMON_READER_H
33

4-
/* Generated by flatcc 0.6.1-dev FlatBuffers schema compiler for C by dvide.com */
4+
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
55

66
/* Common FlatBuffers read functionality for C. */
77

examples/c-cursor-no-gen/task_builder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef TASK_BUILDER_H
22
#define TASK_BUILDER_H
33

4-
/* Generated by flatcc 0.6.1-dev FlatBuffers schema compiler for C by dvide.com */
4+
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
55

66
#ifndef TASK_READER_H
77
#include "task_reader.h"
@@ -14,7 +14,7 @@
1414
#define flatbuffers_identifier 0
1515
#endif
1616
#ifndef flatbuffers_extension
17-
#define flatbuffers_extension ".bin"
17+
#define flatbuffers_extension "bin"
1818
#endif
1919

2020
static const flatbuffers_voffset_t __Task_required[] = { 0 };

0 commit comments

Comments
 (0)