ntirpc
ntirpc copied to clipboard
CMakeLists.txt: Make libnsl optional
YP libnsl functionality is already protected by ifdef guards where necessary and there are usecases where it is not required. Add USE_LIBNSL as a build system knob. Fixes #254
Signed-off-by: Paulo Neves [email protected]
In the new commit you can just disable USE_LIBNSL and make the tests you wish even on Fedora. That is possible as the detection of libnsl is disabled with that setting.
@dang i believe the parts that are dependent on NSL but are not protected, are not built at all.
I found some manually but they were not even in the build list. I did not submit changes on that code as protecting on dead code does not make much sense to me. On the other hand i did not want to add removal of dead code to this PR.
If the link is failing, then some code must be using NSL, and we need to find and protect it.
Ah I understand. I think it is just the FindNSL code that automatically adds -lnsl2 to the linking command, regardless of code needing it. I get your point though and will have a closer look.