ntirpc icon indicating copy to clipboard operation
ntirpc copied to clipboard

CMakeLists.txt: Make libnsl optional

Open ptsneves opened this issue 3 years ago • 5 comments

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]

ptsneves avatar Sep 07 '22 10:09 ptsneves

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.

ptsneves avatar Sep 14 '22 19:09 ptsneves

@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.

ptsneves avatar Sep 15 '22 14:09 ptsneves

If the link is failing, then some code must be using NSL, and we need to find and protect it.

dang avatar Sep 15 '22 14:09 dang

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.

ptsneves avatar Sep 15 '22 14:09 ptsneves