diff --git a/bindings/cpp/CMakeLists.txt b/bindings/cpp/CMakeLists.txt index 05c58ea7..a8f527ed 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 539e3130..1a8d9f2f 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 b5eb9676..ebf5f092 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() {