From c66e8ca4917f99415dc70ec9fa447314567a34da Mon Sep 17 00:00:00 2001 From: Mikhail Koviazin Date: Mon, 19 Feb 2024 11:28:31 +0200 Subject: [PATCH] [C++] do not hardcode Unix Makefiles generator (#2745) Instead, use `cmake --build`. It has been mentioned at least in cmake 3.2 documentation [1] which has been released in 2015. This will make a build process more flexible to people who want to use different build systems such as Ninja. [1]: https://cmake.org/cmake/help/v3.2/manual/cmake.1.html --- lang/c++/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/c++/build.sh b/lang/c++/build.sh index f31c91feff3..81530ed0f2d 100755 --- a/lang/c++/build.sh +++ b/lang/c++/build.sh @@ -71,10 +71,10 @@ function do_dist() { fi } -(mkdir -p build; cd build; cmake --version; cmake -G "Unix Makefiles" ..) for target in "$@" do +cmake -S . -B build case "$target" in lint) # some versions of cppcheck seem to require an explicit @@ -83,7 +83,7 @@ case "$target" in ;; test) - (cd build && cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D AVRO_ADD_PROTECTOR_FLAGS=1 .. && make && cd .. \ + (cmake -S. -Bbuild -D CMAKE_BUILD_TYPE=Debug -D AVRO_ADD_PROTECTOR_FLAGS=1 && cmake --build build \ && ./build/buffertest \ && ./build/unittest \ && ./build/CodecTests \ @@ -105,7 +105,7 @@ case "$target" in ;; dist) - (cd build && cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release ..) + (cd build && cmake -D CMAKE_BUILD_TYPE=Release ..) do_dist do_doc ;; @@ -119,12 +119,12 @@ case "$target" in ;; clean) - (cd build && make clean) + (cmake --build build --target clean) rm -rf doc test.avro test?.df test??.df test_skip.df test_lastSync.df test_readRecordUsingLastSync.df ;; install) - (cd build && cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release .. && make install) + (cmake -S. -Bbuild -D CMAKE_BUILD_TYPE=Release && cmake --build build --target install) ;; *)