Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix][build] Hide non-exported symbols from the dependencies (#155)
### Motivation Currently the released libraries don't hide the symbols from the dependencies, it can be verified by the following steps on Ubuntu: ```bash curl -O -L https://archive.apache.org/dist/pulsar/pulsar-client-cpp-3.1.0/deb-x86_64/apache-pulsar-client.deb apt install ./apache-pulsar-client.deb nm -D /usr/lib/libpulsar.so | grep curl ``` You will see lots of symbols from libcurl are included in `libpulsar.so`: ``` 0000000000709f50 T curl_easy_cleanup 000000000070a000 T curl_easy_duphandle ... ``` The root cause is that `-Wl,--exclude-libs,ALL` is added as the compile option, but it should work as a link option. ### Modifications Use `add_link_options` to add `-Wl,--exclude-libs=ALL` as the link option. It seems that `=ALL` should be correct but `,ALL` also works. (cherry picked from commit 3a3e973)
- Loading branch information