BewareMyPower commented on code in PR #371: URL: https://github.com/apache/pulsar-client-cpp/pull/371#discussion_r1426174836
########## README.md: ########## @@ -31,239 +31,83 @@ For how to use APIs to publish and consume messages, see [examples](https://gith Pulsar C++ client uses [doxygen](https://www.doxygen.nl) to build API documents. After installing `doxygen`, you only need to run `doxygen` to generate the API documents whose main page is under the `doxygen/html/index.html` path. -## Requirements +## Build with vcpkg -- A C++ compiler that supports C++11, like GCC >= 4.8 -- CMake >= 3.13 -- [Boost](http://www.boost.org/) -- [Protocol Buffer](https://developers.google.com/protocol-buffers/) >= 3 -- [libcurl](https://curl.se/libcurl/) -- [openssl](https://github.com/openssl/openssl) +Since it's integrated with vcpkg, see [vcpkg#README](https://github.com/microsoft/vcpkg#readme) for the requirements. See [LEGACY_BUILD](./LEGACY_BUILD.md) if you want to manage dependencies by yourself or you cannot install vcpkg in your own environment. -The default supported [compression types](include/pulsar/CompressionType.h) are: - -- `CompressionNone` -- `CompressionLZ4` - -If you want to enable other compression types, you need to install: - -- `CompressionZLib`: [zlib](https://zlib.net/) -- `CompressionZSTD`: [zstd](https://github.com/facebook/zstd) -- `CompressionSNAPPY`: [snappy](https://github.com/google/snappy) - -If you want to build and run the tests, you need to install [GTest](https://github.com/google/googletest). Otherwise, you need to add CMake option `-DBUILD_TESTS=OFF`. - -The [dependencies.yaml](./dependencies.yaml) file provides the recommended dependency versions, while you can still build from source with other dependency versions. If a dependency requires a higher C++ standard, e.g. C++14, you can specify the standard like: +### How to build from source ```bash -cmake . -DCMAKE_CXX_STANDARD=14 -``` - -> **Note**: -> -> On macOS, the default C++ standard is 17 because the latest Protobuf from Homebrew requires the C++17 support. - -## Platforms - -Pulsar C++ Client Library has been tested on: - -- Linux -- Mac OS X -- Windows x64 - -## Compilation - -### Clone - -First of all, clone the source code: - -```shell -git clone https://github.com/apache/pulsar-client-cpp +git clone https://github.com/apache/pulsar-client-cpp.git cd pulsar-client-cpp +git submodule update --init --recursive +cmake -B build -DINTEGRATE_VCPKG=ON +cmake --build build -j8 ``` -### Compile on Ubuntu - -#### Install all dependencies: - -```shell -sudo apt-get update -y && sudo apt-get install -y g++ cmake libssl-dev libcurl4-openssl-dev \ - libprotobuf-dev libboost-all-dev libgtest-dev libgmock-dev \ - protobuf-compiler -``` - -#### Compile Pulsar client library: - -```shell -cmake . -make -``` - -If you want to build performance tools, you need to run: - -```shell -cmake . -DBUILD_PERF_TOOLS=ON -make -``` - -#### Checks - -Client library will be placed in: - -``` -lib/libpulsar.so -lib/libpulsar.a -``` - -Examples will be placed in: - -``` -examples/ -``` - -Tools will be placed in: - -``` -perf/perfProducer -perf/perfConsumer -``` - -### Compile on Mac OS X +The 1st step will download vcpkg and then install all dependencies according to the version description in [vcpkg.json](./vcpkg.json). The 2nd step will build the Pulsar C++ libraries under `./build/lib/`, where `./build` is the CMake build directory. Review Comment: @shibd I added the link here. For those who manage dependencies by themselves, `LEGACY_BUILD.md` (the previous document) already documents it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
