-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Libs line in toxcore.pc pkg-config file. #325
Conversation
CMake lists are `;` separated and CMAKE_THREAD_LIBS_INIT contains "-lpthread". This resulted in "-l-lpthread;-lrt" on Linux.
40b7f1a
to
bb0fbf9
Compare
Reviewed 1 of 1 files at r1. Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. CMakeLists.txt, line 528 at r1 (raw file):
In CMake you need to know whether a variable is just a string, or a list of strings. The list being just a ...
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
...
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt")
...
set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi") You can see that it's us who make ...
set(toxcore_PKGCONFIG_LIBS "${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT}")
...
set(toxcore_PKGCONFIG_LIBS "${toxcore_PKGCONFIG_LIBS} -lrt")
...
set(toxcore_PKGCONFIG_LIBS "${toxcore_PKGCONFIG_LIBS} -lws2_32 -liphlpapi") (note the changed quotation marks, which make the Comments from Reviewable |
CMakeLists.txt, line 528 at r1 (raw file): Previously, nurupo wrote…
s/tow arguments /two arguments/ Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. CMakeLists.txt, line 528 at r1 (raw file): Previously, nurupo wrote…
I specifically chose not to do it this way. One reason is that I wasn't sure whether CMAKE_THREAD_LIBS_INIT is a list or a string (turns out it doesn't matter, because it's always exactly empty or 1 element). The more important reason is that with the proposed string concatenation instead of list building, you end up with a leading space, which either makes the output .pc or the input .pc.in file ugly. I ended up searching google for "cmake list to space separated string" and found this. Someone commented that it doesn't work.. it does, though. There could be some issues, but I don't see how they would be resolved using a foreach loop. Issues I see are:
Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. CMakeLists.txt, line 528 at r1 (raw file): Previously, iphydf wrote…
Okay. Comments from Reviewable |
Reviewed 1 of 1 files at r1. Comments from Reviewable |
CMake lists are
;
separated and CMAKE_THREAD_LIBS_INIT contains"-lpthread". This resulted in "-l-lpthread;-lrt" on Linux.
This change is