This is an automated email from the ASF dual-hosted git repository.
jt2594838 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 8cdc9681d01 [C++] Fix macOS OpenSSL header isolation and upgrade
Thrift to 0.25.0 (#18968)
8cdc9681d01 is described below
commit 8cdc9681d0141fa51cfd0dc120b67a7383270865
Author: Hongzhi Gao <[email protected]>
AuthorDate: Wed Oct 28 16:33:15 2026 +0800
[C++] Fix macOS OpenSSL header isolation and upgrade Thrift to 0.25.0
(#18968)
* Fix Boost header isolation and upgrade C++ Thrift to 0.25.0
* Include Boost resolution regression fixture
* Refresh C++ dependency version notes
* Keep C++11 consumers while compiling Thrift-generated code as C++17
* Include standalone C++11 consumer build fixture
* Limit Windows SDK headers in the private C++17 build
---
.github/workflows/multi-language-client.yml | 16 ++++-
iotdb-client/client-cpp/CMakeLists.txt | 9 ++-
iotdb-client/client-cpp/README.md | 18 +++---
iotdb-client/client-cpp/README_zh.md | 3 +
iotdb-client/client-cpp/cmake/FetchBoost.cmake | 17 +++++-
.../client-cpp/cmake/FetchBuildTools.cmake | 2 +-
iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake | 2 +-
iotdb-client/client-cpp/examples/README.md | 2 +-
iotdb-client/client-cpp/examples/README_zh.md | 2 +-
.../package-metadata/third_party/DEPENDENCIES.md | 2 +-
.../client-cpp/test/cmake/FetchBoostTest.cmake | 68 ++++++++++++++++++++++
.../test/cmake/cxx11-consumer/CMakeLists.txt | 40 +++++++++++++
.../client-cpp/test/cmake/cxx11-consumer/main.cpp | 34 +++++++++++
iotdb-client/client-cpp/third-party/README.md | 6 +-
14 files changed, 200 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/multi-language-client.yml
b/.github/workflows/multi-language-client.yml
index b49b63b2e5c..8c1cfd3ec80 100644
--- a/.github/workflows/multi-language-client.yml
+++ b/.github/workflows/multi-language-client.yml
@@ -168,8 +168,8 @@ jobs:
$boost_path = (Get-ChildItem -Path 'C:\local\' -Filter
'boost_*').FullName
echo $boost_path >> $env:GITHUB_PATH
- # Pinned OpenSSL 3.x (Apache-2.0): 'choco install openssl' now
installs
- # OpenSSL 4.0, which removed the legacy TLS-method APIs Thrift uses.
+ # Keep system-OpenSSL validation on the same major version as the
+ # default bundled OpenSSL 3.x (Apache-2.0).
$sslZip = "$env:RUNNER_TEMP\openssl-3.5.3.zip"
$sslDir = "$env:RUNNER_TEMP\openssl-3"
curl.exe -L --fail --retry 3 -o $sslZip
'https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.5.3.zip'
@@ -186,6 +186,10 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-${{ runner.arch }}-m2-${{
hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-m2-
+ - name: Test Boost include resolution
+ if: runner.os != 'Windows'
+ shell: bash
+ run: cmake -DTEST_BINARY_DIR="$RUNNER_TEMP/boost-include-test" -P
iotdb-client/client-cpp/test/cmake/FetchBoostTest.cmake
- name: Check C++ format (Spotless)
shell: bash
run: |
@@ -207,6 +211,14 @@ jobs:
else
./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp -am
-Diotdb.openssl.from.source=OFF
fi
+ - name: Test installed SDK with a C++11 consumer
+ shell: bash
+ run: |
+ cmake -S iotdb-client/client-cpp/test/cmake/cxx11-consumer \
+ -B iotdb-client/client-cpp/target/cxx11-consumer \
+
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/iotdb-client/client-cpp/target/install"
+ cmake --build iotdb-client/client-cpp/target/cxx11-consumer --config
Release
+ ctest --test-dir iotdb-client/client-cpp/target/cxx11-consumer -C
Release --output-on-failure
- name: Upload Artifact
if: failure()
uses: actions/upload-artifact@v6
diff --git a/iotdb-client/client-cpp/CMakeLists.txt
b/iotdb-client/client-cpp/CMakeLists.txt
index f6178d183d8..74bc33f1b0f 100644
--- a/iotdb-client/client-cpp/CMakeLists.txt
+++ b/iotdb-client/client-cpp/CMakeLists.txt
@@ -97,7 +97,7 @@ else()
endif()
set(BOOST_VERSION "${_iotdb_default_boost_version}"
CACHE STRING "Boost version used when downloading / unpacking (Thrift
build only)")
-set(THRIFT_VERSION "0.24.0"
+set(THRIFT_VERSION "0.25.0"
CACHE STRING "Apache Thrift version used when downloading / building")
if(WIN32)
@@ -135,7 +135,14 @@ add_library(iotdb_session SHARED
${SESSION_RPC_SRCS}
${THRIFT_GENERATED_SRCS})
+# Thrift 0.25 generates vector<bool>::emplace_back(), which requires C++17
+# with libc++. Keep this private to the library; examples and consumers use
C++11.
+set_target_properties(iotdb_session PROPERTIES CXX_STANDARD 17)
+
if(WIN32)
+ # Exclude unused Windows RPC/COM headers: their byte typedef conflicts with
+ # std::byte when included after the SDK's public using-directives.
+ target_compile_definitions(iotdb_session PRIVATE WIN32_LEAN_AND_MEAN)
set_target_properties(iotdb_session PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS
ON)
endif()
diff --git a/iotdb-client/client-cpp/README.md
b/iotdb-client/client-cpp/README.md
index d4fdb8de2ef..1d4a59ebd7b 100644
--- a/iotdb-client/client-cpp/README.md
+++ b/iotdb-client/client-cpp/README.md
@@ -28,6 +28,10 @@ not need Maven, Thrift, Boost, or this source tree to use it
in your own
application. Unpack the zip, point your build system at its `include/` and
`lib/` directories, and deploy the IoTDB runtime library with your executable.
+Building the SDK from source requires a C++17-capable compiler for the internal
+library and generated Thrift code. Applications using the packaged public API
+can continue to compile as C++11.
+
## Use a packaged SDK in your project
### 1. Pick and unpack the right package
@@ -300,7 +304,7 @@ so they require glibc 2.28 or newer on the deployment host.
| ppc64le | `quay.io/pypa/manylinux_2_28_ppc64le` |
| s390x | `quay.io/pypa/manylinux_2_28_s390x` |
-Thrift **0.24.0** is compiled from source during the CMake configure step (see
+Thrift **0.25.0** is compiled from source during the CMake configure step (see
`cmake/FetchThrift.cmake`). Older releases that used pre-built
`iotdb-tools-thrift` Maven artifacts and `-Diotdb-tools-thrift.version=...`
for glibc/MSVC compatibility apply only to the **legacy** client-cpp build;
@@ -384,7 +388,7 @@ etc. directly.
| `IOTDB_OFFLINE` | `OFF` | Disallow any
network access during configure.
|
| `IOTDB_DEPS_DIR` | `<client-cpp>/third-party` | Override the
local tarball cache directory.
|
| `BOOST_VERSION` | `1.60.0` (`1.84.0` on macOS) | Boost version
that CMake will look for / download.
|
-| `THRIFT_VERSION` | `0.24.0` | Apache Thrift
version to build from source.
|
+| `THRIFT_VERSION` | `0.25.0` | Apache Thrift
version to build from source.
|
| `BOOST_ROOT` | (unset) | Existing Boost
install to reuse, equivalent to `-Dboost.include.dir=...` from the legacy
build. |
| `IOTDB_OPENSSL_FROM_SOURCE` | `ON` | Build the
checksum-pinned OpenSSL source release; set `OFF` to opt into system OpenSSL.
|
| `OPENSSL_ROOT_DIR` | (unset) | Existing OpenSSL
install used only when `IOTDB_OPENSSL_FROM_SOURCE=OFF`.
|
@@ -428,12 +432,12 @@ cmake --build build --config Release --target install
| Platform | Required files
|
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
- | `linux/` | `thrift-0.24.0.tar.gz`, `boost_1_60_0.tar.gz`,
`m4-1.4.19.tar.gz`, `flex-2.6.4.tar.gz`, `bison-3.8.tar.gz`,
`openssl-3.5.8.tar.gz` |
- | `mac/` | `thrift-0.24.0.tar.gz`, `boost_1_84_0.tar.gz`,
`openssl-3.5.8.tar.gz` |
- | `windows/` | `thrift-0.24.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz` |
+ | `linux/` | `thrift-0.25.0.tar.gz`, `boost_1_60_0.tar.gz`,
`m4-1.4.19.tar.gz`, `flex-2.6.4.tar.gz`, `bison-3.8.tar.gz`,
`openssl-3.5.8.tar.gz` |
+ | `mac/` | `thrift-0.25.0.tar.gz`, `boost_1_84_0.tar.gz`,
`openssl-3.5.8.tar.gz` |
+ | `windows/` | `thrift-0.25.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz` |
Reference URLs (the configure step uses the same):
- - Apache Thrift 0.24.0:
<https://archive.apache.org/dist/thrift/0.24.0/thrift-0.24.0.tar.gz>
+ - Apache Thrift 0.25.0:
<https://archive.apache.org/dist/thrift/0.25.0/thrift-0.25.0.tar.gz>
- Boost 1.60.0:
<https://archives.boost.io/release/1.60.0/source/boost_1_60_0.tar.gz>
- GNU m4 1.4.19: <https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz>
- GNU flex 2.6.4:
<https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz>
@@ -462,7 +466,7 @@ CI environments can share a single cache by setting
### Linux
- Tested with GCC 7+ and Clang 9+. Anything that can compile Apache Thrift
- 0.24.0 works.
+ 0.25.0 works.
- Build deps that must already exist on the host (only required when
CMake auto-builds m4/flex/bison from tarball): `make`, `autoconf`,
`gcc`, plus the standard C/C++ toolchain. `sudo` is **not** required;
diff --git a/iotdb-client/client-cpp/README_zh.md
b/iotdb-client/client-cpp/README_zh.md
index f2c591c2b2c..30e5f678862 100644
--- a/iotdb-client/client-cpp/README_zh.md
+++ b/iotdb-client/client-cpp/README_zh.md
@@ -29,6 +29,9 @@
其中的 `include/` 和 `lib/`,并在运行时把 IoTDB 动态库随可执行文件一起部署
即可。
+从源码构建 SDK 时,内部库及 Thrift 生成代码需要支持 C++17 的编译器。
+使用已打包 SDK 公开 API 的应用仍可按 C++11 编译。
+
## 在项目中使用已打好的 SDK 包
### 1. 选择并解压正确的包
diff --git a/iotdb-client/client-cpp/cmake/FetchBoost.cmake
b/iotdb-client/client-cpp/cmake/FetchBoost.cmake
index d1ab9c18ae1..f669ffe3d61 100644
--- a/iotdb-client/client-cpp/cmake/FetchBoost.cmake
+++ b/iotdb-client/client-cpp/cmake/FetchBoost.cmake
@@ -30,7 +30,18 @@
# BOOST_INCLUDE_DIR - directory containing <boost/...> headers.
# =============================================================================
+# Homebrew links include/boost into the formula's keg. Resolve that link,
+# not just the include directory: a shared prefix such as /opt/homebrew/include
+# also exposes unrelated OpenSSL headers ahead of Thrift's selected OpenSSL.
+function(_iotdb_set_boost_include_dir include_dir)
+ get_filename_component(_boost_headers "${include_dir}/boost" REALPATH)
+ get_filename_component(_boost_include "${_boost_headers}" DIRECTORY)
+ set(BOOST_INCLUDE_DIR "${_boost_include}" CACHE PATH "Boost include
directory" FORCE)
+ set(BOOST_INCLUDE_DIR "${_boost_include}" PARENT_SCOPE)
+endfunction()
+
if(DEFINED BOOST_INCLUDE_DIR AND EXISTS
"${BOOST_INCLUDE_DIR}/boost/version.hpp")
+ _iotdb_set_boost_include_dir("${BOOST_INCLUDE_DIR}")
message(STATUS "[Boost] reusing cached
BOOST_INCLUDE_DIR=${BOOST_INCLUDE_DIR}")
return()
endif()
@@ -40,7 +51,7 @@ endif()
# ---------------------------------------------------------------------------
find_package(Boost QUIET)
if(Boost_FOUND AND Boost_INCLUDE_DIRS)
- set(BOOST_INCLUDE_DIR "${Boost_INCLUDE_DIRS}" CACHE PATH "Boost include
directory" FORCE)
+ _iotdb_set_boost_include_dir("${Boost_INCLUDE_DIRS}")
message(STATUS "[Boost] using system Boost at ${BOOST_INCLUDE_DIR}")
return()
endif()
@@ -50,11 +61,11 @@ foreach(_hint Boost_INCLUDE_DIR BOOST_INCLUDEDIR BOOST_ROOT)
if(DEFINED ${_hint})
set(_candidate "${${_hint}}")
if(EXISTS "${_candidate}/boost/version.hpp")
- set(BOOST_INCLUDE_DIR "${_candidate}" CACHE PATH "Boost include
directory" FORCE)
+ _iotdb_set_boost_include_dir("${_candidate}")
message(STATUS "[Boost] using hinted path ${BOOST_INCLUDE_DIR}")
return()
elseif(EXISTS "${_candidate}/include/boost/version.hpp")
- set(BOOST_INCLUDE_DIR "${_candidate}/include" CACHE PATH "Boost
include directory" FORCE)
+ _iotdb_set_boost_include_dir("${_candidate}/include")
message(STATUS "[Boost] using hinted path ${BOOST_INCLUDE_DIR}")
return()
endif()
diff --git a/iotdb-client/client-cpp/cmake/FetchBuildTools.cmake
b/iotdb-client/client-cpp/cmake/FetchBuildTools.cmake
index 5860d68ac19..8a2bce45436 100644
--- a/iotdb-client/client-cpp/cmake/FetchBuildTools.cmake
+++ b/iotdb-client/client-cpp/cmake/FetchBuildTools.cmake
@@ -253,7 +253,7 @@ if(NOT FLEX_EXECUTABLE)
endif()
message(STATUS "[BuildTools] flex = ${FLEX_EXECUTABLE}")
-# bison - Thrift 0.24's grammar build uses bison >= 3.7 features (e.g. the
+# bison - Thrift 0.25's grammar build uses bison >= 3.7 features (e.g. the
# --file-prefix-map option), so reject an older system bison (manylinux_2_28
# ships 3.0.4) and build ${BISON_VERSION} from source instead.
set(_bison_min_version "3.7")
diff --git a/iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake
b/iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake
index 165736dd160..1c3098d31a5 100644
--- a/iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake
+++ b/iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake
@@ -18,7 +18,7 @@
# =============================================================================
# FetchOpenSSL.cmake (only included when WITH_SSL=ON)
#
-# Apache Thrift 0.24 (bundled by this client) builds against OpenSSL 3.x.
+# OpenSSL 3.x remains the default bundled dependency for the C++ client.
#
# By default, a fixed OpenSSL source release is downloaded, checksum-verified,
# built as shared libraries, and installed under ${CMAKE_BINARY_DIR}/_deps.
diff --git a/iotdb-client/client-cpp/examples/README.md
b/iotdb-client/client-cpp/examples/README.md
index 1910135eefc..b3ade12a7ae 100644
--- a/iotdb-client/client-cpp/examples/README.md
+++ b/iotdb-client/client-cpp/examples/README.md
@@ -53,7 +53,7 @@ publishes one zip per platform/toolchain:
| macOS arm64 | `macos-aarch64` |
| Windows (match your Visual Studio version) | `windows-x86_64-msvc14.1` ...
`msvc14.4` |
-The current build compiles Thrift 0.24 from source at CMake configure time.
+The current build compiles Thrift 0.25 from source at CMake configure time.
Legacy `-Diotdb-tools-thrift.version=...` flags applied to the **old**
pre-built Thrift workflow only. Linux release packages are built in the
`manylinux_2_28` container and require glibc 2.28 or newer. See
diff --git a/iotdb-client/client-cpp/examples/README_zh.md
b/iotdb-client/client-cpp/examples/README_zh.md
index a00b93a57d4..34524ad8daa 100644
--- a/iotdb-client/client-cpp/examples/README_zh.md
+++ b/iotdb-client/client-cpp/examples/README_zh.md
@@ -52,7 +52,7 @@ CI
发版([client-cpp-package.yml](../../.github/workflows/client-cpp-package.
| macOS arm64 | `macos-aarch64` |
| Windows + 与工程相同的 VS 版本 | `windows-x86_64-msvc14.1` ... `msvc14.4` |
-当前 CMake 构建在配置阶段从源码编译 Thrift 0.24,**不再**通过
+当前 CMake 构建在配置阶段从源码编译 Thrift 0.25,**不再**通过
`-Diotdb-tools-thrift.version=0.14.1.1-gcc4-SNAPSHOT` 等旧参数控制 glibc;
Linux 发版包在 `manylinux_2_28` 容器中构建,部署机需要 glibc 2.28 或更新版本。
详见 [client-cpp README](../../iotdb-client/client-cpp/README.md)。
diff --git
a/iotdb-client/client-cpp/src/assembly/package-metadata/third_party/DEPENDENCIES.md
b/iotdb-client/client-cpp/src/assembly/package-metadata/third_party/DEPENDENCIES.md
index da8b7698a70..258c8fd08aa 100644
---
a/iotdb-client/client-cpp/src/assembly/package-metadata/third_party/DEPENDENCIES.md
+++
b/iotdb-client/client-cpp/src/assembly/package-metadata/third_party/DEPENDENCIES.md
@@ -31,7 +31,7 @@ the [`NOTICE`](NOTICE) file in this directory; non-Apache
license texts are unde
| Component | Version | How | License |
| --- | --- | --- | --- |
-| Apache Thrift | 0.24.0 | statically linked | Apache License 2.0 |
+| Apache Thrift | 0.25.0 | statically linked | Apache License 2.0 |
| Boost | 1.60.0 on Linux/Windows, 1.84.0 on macOS by default | statically
linked (header-only) | Boost Software License 1.0 |
| OpenSSL | 3.5.8 built from checksum-pinned source (`WITH_SSL=ON`, default) |
bundled shared libs in `lib/` | Apache License 2.0 |
diff --git a/iotdb-client/client-cpp/test/cmake/FetchBoostTest.cmake
b/iotdb-client/client-cpp/test/cmake/FetchBoostTest.cmake
new file mode 100644
index 00000000000..ea00dbd1e7f
--- /dev/null
+++ b/iotdb-client/client-cpp/test/cmake/FetchBoostTest.cmake
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Run with cmake -DTEST_BINARY_DIR=<scratch-dir> -P <this-file> on Unix.
+cmake_minimum_required(VERSION 3.16)
+
+if(NOT TEST_BINARY_DIR)
+ message(FATAL_ERROR "Set TEST_BINARY_DIR to a scratch directory")
+endif()
+get_filename_component(TEST_BINARY_DIR "${TEST_BINARY_DIR}" ABSOLUTE)
+get_filename_component(_fetch_boost
"${CMAKE_CURRENT_LIST_DIR}/../../cmake/FetchBoost.cmake" ABSOLUTE)
+set(_keg "${TEST_BINARY_DIR}/Cellar/boost/1.90.0/include")
+set(_shared "${TEST_BINARY_DIR}/include")
+file(MAKE_DIRECTORY "${_keg}/boost" "${_shared}/openssl"
"${TEST_BINARY_DIR}/modules")
+file(WRITE "${_keg}/boost/version.hpp" "#define BOOST_VERSION 109000\n")
+file(WRITE "${_shared}/openssl/ssl.h" "#error Unrelated OpenSSL headers must
not be exposed by Boost\n")
+file(CREATE_LINK "${_keg}/boost" "${_shared}/boost" SYMBOLIC)
+file(WRITE "${TEST_BINARY_DIR}/modules/FindBoost.cmake" "
+set(Boost_FOUND \${TEST_BOOST_FOUND})
+set(Boost_INCLUDE_DIRS \${TEST_BOOST_INCLUDE_DIRS})
+")
+set(CMAKE_MODULE_PATH "${TEST_BINARY_DIR}/modules")
+set(IOTDB_OFFLINE ON)
+
+function(check_include source include_dir expected)
+ unset(BOOST_INCLUDE_DIR CACHE)
+ set(TEST_BOOST_FOUND FALSE)
+ if(source STREQUAL "find_package")
+ set(TEST_BOOST_FOUND TRUE)
+ set(TEST_BOOST_INCLUDE_DIRS "${include_dir}")
+ elseif(source STREQUAL "cache")
+ set(BOOST_INCLUDE_DIR "${include_dir}" CACHE PATH "" FORCE)
+ else()
+ set(${source} "${include_dir}")
+ endif()
+ include("${_fetch_boost}")
+ get_filename_component(expected "${expected}" REALPATH)
+ if(NOT BOOST_INCLUDE_DIR STREQUAL expected)
+ message(FATAL_ERROR "${source}: expected ${expected}, got
${BOOST_INCLUDE_DIR}")
+ endif()
+ # Reconfiguration must also retain the isolated path.
+ include("${_fetch_boost}")
+ if(NOT BOOST_INCLUDE_DIR STREQUAL expected)
+ message(FATAL_ERROR "${source}: cached path changed to
${BOOST_INCLUDE_DIR}")
+ endif()
+ message(STATUS "PASS ${source}: ${include_dir}")
+ unset(BOOST_INCLUDE_DIR CACHE)
+endfunction()
+
+foreach(source find_package cache BOOST_INCLUDE_DIR Boost_INCLUDE_DIR
BOOST_INCLUDEDIR)
+ check_include("${source}" "${_shared}" "${_keg}")
+ check_include("${source}" "${_keg}" "${_keg}")
+endforeach()
+check_include(BOOST_ROOT "${TEST_BINARY_DIR}" "${_keg}")
diff --git a/iotdb-client/client-cpp/test/cmake/cxx11-consumer/CMakeLists.txt
b/iotdb-client/client-cpp/test/cmake/cxx11-consumer/CMakeLists.txt
new file mode 100644
index 00000000000..e14e1349e47
--- /dev/null
+++ b/iotdb-client/client-cpp/test/cmake/cxx11-consumer/CMakeLists.txt
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+cmake_minimum_required(VERSION 3.16)
+project(iotdb_cxx11_consumer LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+find_package(iotdb-session REQUIRED CONFIG)
+
+add_executable(cxx11_consumer main.cpp)
+target_link_libraries(cxx11_consumer PRIVATE IoTDB::iotdb_session)
+if(WIN32)
+ get_target_property(_sdk_runtime IoTDB::iotdb_session IMPORTED_LOCATION)
+ get_filename_component(_sdk_lib_dir "${_sdk_runtime}" DIRECTORY)
+ file(GLOB _sdk_dlls "${_sdk_lib_dir}/*.dll")
+ foreach(_dll IN LISTS _sdk_dlls)
+ add_custom_command(TARGET cxx11_consumer POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${_dll}" $<TARGET_FILE_DIR:cxx11_consumer>)
+ endforeach()
+endif()
+
+enable_testing()
+add_test(NAME cxx11_consumer COMMAND cxx11_consumer)
diff --git a/iotdb-client/client-cpp/test/cmake/cxx11-consumer/main.cpp
b/iotdb-client/client-cpp/test/cmake/cxx11-consumer/main.cpp
new file mode 100644
index 00000000000..beba645db91
--- /dev/null
+++ b/iotdb-client/client-cpp/test/cmake/cxx11-consumer/main.cpp
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "Session.h"
+
+#ifndef _MSC_VER
+static_assert(__cplusplus == 201103L, "The public SDK must remain usable from
C++11");
+#endif
+
+int main() {
+ Session session("127.0.0.1", 6667);
+ try {
+ session.executeQueryStatement("SHOW VERSION");
+ } catch (const IoTDBConnectionException&) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/iotdb-client/client-cpp/third-party/README.md
b/iotdb-client/client-cpp/third-party/README.md
index 1817c0fe11f..cdb2a9f09f0 100644
--- a/iotdb-client/client-cpp/third-party/README.md
+++ b/iotdb-client/client-cpp/third-party/README.md
@@ -68,8 +68,8 @@ Alternatively copy files manually from the URLs listed in
| Platform | Typical files |
|------------|---------------|
-| `linux/` | `thrift-0.24.0.tar.gz`, `boost_1_60_0.tar.gz`,
`m4-1.4.19.tar.gz`, `flex-2.6.4.tar.gz`, `bison-3.8.tar.gz`,
`openssl-3.5.8.tar.gz` when `WITH_SSL=ON` |
-| `mac/` | `thrift-0.24.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz` (Xcode CLT usually provides m4/flex/bison) |
-| `windows/` | `thrift-0.24.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz`, `win_flex_bison-2.5.25.zip` (or any
`win_flex_bison*.zip`; skip if flex/bison already on `PATH`) |
+| `linux/` | `thrift-0.25.0.tar.gz`, `boost_1_60_0.tar.gz`,
`m4-1.4.19.tar.gz`, `flex-2.6.4.tar.gz`, `bison-3.8.tar.gz`,
`openssl-3.5.8.tar.gz` when `WITH_SSL=ON` |
+| `mac/` | `thrift-0.25.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz` (Xcode CLT usually provides m4/flex/bison) |
+| `windows/` | `thrift-0.25.0.tar.gz`, `boost_1_60_0.tar.gz`,
`openssl-3.5.8.tar.gz`, `win_flex_bison-2.5.25.zip` (or any
`win_flex_bison*.zip`; skip if flex/bison already on `PATH`) |
Download URLs: see the *Offline build* table in [`README.md`](../README.md).