This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
The following commit(s) were added to refs/heads/main by this push:
new a3ab06a chore: default cpp builds to release mode (#345)
a3ab06a is described below
commit a3ab06afb3495101c280e3d626fcc33176339e3a
Author: AlexZhao <[email protected]>
AuthorDate: Mon Feb 16 19:37:24 2026 +0800
chore: default cpp builds to release mode (#345)
---
bindings/cpp/CMakeLists.txt | 4 ++--
bindings/cpp/README.md | 3 +++
bindings/cpp/ci.sh | 7 ++++---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/bindings/cpp/CMakeLists.txt b/bindings/cpp/CMakeLists.txt
index 05c58ea..a8f527e 100644
--- a/bindings/cpp/CMakeLists.txt
+++ b/bindings/cpp/CMakeLists.txt
@@ -32,7 +32,7 @@ find_package(Threads REQUIRED)
find_package(Arrow REQUIRED)
if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 17)
@@ -122,4 +122,4 @@ add_dependencies(fluss_cpp cargo_build)
if (FLUSS_ENABLE_ADDRESS_SANITIZER)
target_compile_options(fluss_cpp PRIVATE -fsanitize=leak,address,undefined
-fno-omit-frame-pointer -fno-common -O1)
target_link_options(fluss_cpp PRIVATE -fsanitize=leak,address,undefined)
-endif()
\ No newline at end of file
+endif()
diff --git a/bindings/cpp/README.md b/bindings/cpp/README.md
index 539e313..1a8d9f2 100644
--- a/bindings/cpp/README.md
+++ b/bindings/cpp/README.md
@@ -22,12 +22,15 @@ cmake ..
cmake --build .
```
+By default, CMake now uses `Release` when `CMAKE_BUILD_TYPE` is not specified.
+
**With Bazel:**
```bash
cd bindings/cpp
bazel build //...
```
+`ci.sh` defaults to optimized builds via `-c opt` (override with
`BAZEL_BUILD_FLAGS` if needed).
See [ci.sh](ci.sh) for the CI build sequence.
diff --git a/bindings/cpp/ci.sh b/bindings/cpp/ci.sh
index b5eb967..ebf5f09 100755
--- a/bindings/cpp/ci.sh
+++ b/bindings/cpp/ci.sh
@@ -19,6 +19,7 @@
set -xe
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
+BAZEL_BUILD_FLAGS="${BAZEL_BUILD_FLAGS:--c opt}"
# Set Bazel output base to bazel-build directory
# This ensures all Bazel outputs are in bazel-build/.bazel-output-base
@@ -33,16 +34,16 @@ bazel() {
}
compile() {
- bazel build //:fluss_cpp
+ bazel build ${BAZEL_BUILD_FLAGS} //:fluss_cpp
}
build_example() {
- bazel build //:fluss_cpp_example
+ bazel build ${BAZEL_BUILD_FLAGS} //:fluss_cpp_example
}
run_example() {
build_example
- bazel run //:fluss_cpp_example
+ bazel run ${BAZEL_BUILD_FLAGS} //:fluss_cpp_example
}
clean() {