Skip to content

Commit bd04459

Browse files
authored
Fixed pulsar client node mac install script (#196)
* Fixed pulsar client node mac install script
1 parent d2c0d1e commit bd04459

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ cmake \
6666
cmake --config Release
6767
```
6868

69+
6970
2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a Windows command tool.
7071

7172
```shell
@@ -79,6 +80,28 @@ set PULSAR_CPP_DIR=C:\pulsar\pulsar-client-cpp
7980
set OS_ARCH=x64-windows
8081
```
8182

83+
### Install on mac
84+
85+
1. Install the Pulsar C++ client on mac.
86+
87+
```shell
88+
brew install libpulsar
89+
```
90+
91+
2. Get the installation path of libpulsar
92+
93+
```shell
94+
brew info libpulsar
95+
```
96+
97+
98+
2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
99+
100+
```shell
101+
# for example
102+
export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
103+
```
104+
82105

83106
### Install pulsar-client to your project
84107

binding.gyp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
'pulsar_cpp_dir%': '<!(echo %PULSAR_CPP_DIR%)',
2525
'os_arch%': '<!(echo %OS_ARCH%)',
2626
},
27+
}],
28+
['OS=="mac"', {
29+
'variables': {
30+
'pulsar_cpp_dir': '<!(echo $PULSAR_CPP_DIR)'
31+
}
2732
}]
2833
],
2934
"targets": [
@@ -50,6 +55,14 @@
5055
"src/ReaderConfig.cc",
5156
],
5257
'conditions': [
58+
['OS=="mac"', {
59+
"include_dirs": [
60+
"<(pulsar_cpp_dir)/include",
61+
],
62+
"libraries": [
63+
"<(pulsar_cpp_dir)/lib/libpulsar.dylib"
64+
],
65+
}],
5366
['OS=="win"', {
5467
"include_dirs": [
5568
"<(pulsar_cpp_dir)\include",

0 commit comments

Comments
 (0)