Merge branch 'master' into branch-1.6
diff --git a/README.md b/README.md
index 57ee0fd..cafc5c9 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,7 @@
cmake --config Release
```
+
2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a Windows command tool.
```shell
@@ -79,6 +80,28 @@
set OS_ARCH=x64-windows
```
+### Install on mac
+
+1. Install the Pulsar C++ client on mac.
+
+```shell
+brew install libpulsar
+```
+
+2. Get the installation path of libpulsar
+
+```shell
+brew info libpulsar
+```
+
+
+2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+
+```shell
+# for example
+export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
+```
+
### Install pulsar-client to your project
diff --git a/binding.gyp b/binding.gyp
index 03dd8b5..68629b1 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -24,6 +24,11 @@
'pulsar_cpp_dir%': '<!(echo %PULSAR_CPP_DIR%)',
'os_arch%': '<!(echo %OS_ARCH%)',
},
+ }],
+ ['OS=="mac"', {
+ 'variables': {
+ 'pulsar_cpp_dir': '<!(echo $PULSAR_CPP_DIR)'
+ }
}]
],
"targets": [
@@ -50,6 +55,14 @@
"src/ReaderConfig.cc",
],
'conditions': [
+ ['OS=="mac"', {
+ "include_dirs": [
+ "<(pulsar_cpp_dir)/include",
+ ],
+ "libraries": [
+ "<(pulsar_cpp_dir)/lib/libpulsar.dylib"
+ ],
+ }],
['OS=="win"', {
"include_dirs": [
"<(pulsar_cpp_dir)\include",