Skip to content

Commit

Permalink
[C++] Adjust clang-format search names (apache#13369)
Browse files Browse the repository at this point in the history
* Adjust clang-format search names

* Update pulsar-client-cpp/README.md

Co-authored-by: Anonymitaet <[email protected]>

Co-authored-by: Anonymitaet <[email protected]>
  • Loading branch information
Demogorgon314 and Anonymitaet authored Dec 20, 2021
1 parent 3b462aa commit af9a577
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
20 changes: 20 additions & 0 deletions pulsar-client-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,23 @@ ${PULSAR_PATH}/pulsar-test-service-stop.sh
It's recommended to install [LLVM](https://llvm.org/builds/) for `clang-tidy` and `clang-format`. Pulsar C++ client use `clang-format` 5.0 to format files, which is a little different with latest `clang-format`.

We welcome contributions from the open source community, kindly make sure your changes are backward compatible with GCC 4.8 and Boost 1.53.

### Install `clang-format` on macOS

`homebrew-core` does not have `clang-format@5`. You can install `clang-format@5` on your macOS using the tap below.
```shell
# Step 1: Add tap
brew tap demogorgon314/clang-format

# Step 2: Install clang-format@5
brew install clang-format@5
```
### Install `clang-format` on Ubuntu 18.04
You can find pre-built binaries on the LLVM website: https://releases.llvm.org/download.html#5.0.2

Or you want to use apt install clang-format-5.0.
```shell
sudo apt update
sudo apt install clang-format-5.0
```

7 changes: 2 additions & 5 deletions pulsar-client-cpp/cmake_modules/FindClangTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ if (CLANG_FORMAT_VERSION)
endif()
else()
find_program(CLANG_FORMAT_BIN
NAMES clang-format-4.0
clang-format-3.9
clang-format-3.8
clang-format-3.7
clang-format-3.6
NAMES clang-format-5
clang-format-5.0
clang-format
PATHS ${CLANG_SEARCH_PATHS}
NO_DEFAULT_PATH
Expand Down

0 comments on commit af9a577

Please sign in to comment.