-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Improve CMake code #309
base: master
Are you sure you want to change the base?
Improve CMake code #309
Conversation
Ping? |
vacation! 😉
Am 16. Juni 2019 09:14:06 GMT-07:00 schrieb Rolf Eike Beer <[email protected]>:
…Ping?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#309 (comment)
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
|
Looks like you are back, so ping again ;) |
CMakeLists.txt
Outdated
@@ -640,7 +640,7 @@ function(get_link_libraries OUT TARGET) | |||
set(RESULT "") | |||
get_target_property(LIBRARIES ${TARGET} INTERFACE_LINK_LIBRARIES) | |||
foreach(LIB ${LIBRARIES}) | |||
if("${LIB}" MATCHES ".*NOTFOUND.*") | |||
if(NOT LIB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon NOTFOUND is different to unset. Not sure though. Do you have a link to the docs at hand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are different, but both false. See https://cmake.org/cmake/help/v3.15/command/if.html, section "if()".
CMakeLists.txt
Outdated
@@ -223,11 +223,9 @@ endif() | |||
if(LIBVNCSERVER_HAVE_SYS_UIO_H) | |||
if(WITH_GCRYPT AND LIBGCRYPT_LIBRARIES) | |||
message(STATUS "Building crypto with Libgcrypt") | |||
set(CRYPTO_LIBRARIES ${LIBGCRYPT_LIBRARIES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bettter be verbose than to rely on side effects. wontmerge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is added a few lines below to ADDITIONAL_LIBRARIES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, nothing wrong here and the logic is much better especially see my comment on line 220
@@ -621,30 +621,26 @@ endif() | |||
# | |||
# this gets the libraries needed by TARGET in "-libx -liby ..." form | |||
# | |||
function(get_link_libraries OUT TARGET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check this one
This is fine for me, ADDITIONAL_LIBS correctly contains all the required libs, and i makes the code easier to read.
@@ -110,6 +110,7 @@ endif() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I need some more info on the purpose of this commit :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the GitHub webinterface wont tell me what you added this comment to, so I can't tell you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bk138 this is fine, is just coding style. The endif(expression_name)
has been deprecated a long time ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cherry-picked 2, some are wontmerge, some needinfo, 1 needs a minor addition :-)
Thanks for the contribution!
87a400f
to
a792655
Compare
a792655
to
9e2121b
Compare
What's missing now? |
Mainly time on my side, on parental leave for the time being. I've not forgotten this though :-) |
Big change to the build system to make it more modular, which is good, downside is that the big change increases the probability of regressions. In-depth testing needed, i.e. quite some time investment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -110,6 +110,7 @@ endif() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bk138 this is fine, is just coding style. The endif(expression_name)
has been deprecated a long time ago.
CMakeLists.txt
Outdated
@@ -223,11 +223,9 @@ endif() | |||
if(LIBVNCSERVER_HAVE_SYS_UIO_H) | |||
if(WITH_GCRYPT AND LIBGCRYPT_LIBRARIES) | |||
message(STATUS "Building crypto with Libgcrypt") | |||
set(CRYPTO_LIBRARIES ${LIBGCRYPT_LIBRARIES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, nothing wrong here and the logic is much better especially see my comment on line 220
if(PNG_FOUND) | ||
set(LIBVNCSERVER_HAVE_LIBPNG 1) | ||
else() | ||
unset(PNG_LIBRARIES) # would otherwise contain -NOTFOUND, confusing target_link_libraries() | ||
endif(PNG_FOUND) | ||
if(NOT OPENSSL_FOUND) | ||
unset(OPENSSL_LIBRARIES) # would otherwise contain -NOTFOUND, confusing target_link_libraries() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed unneeded, when OPENSSL_FOUND is NOT FOUND, OPENSSL_LIBRARIES is already unset.
So the change absolutely make sense to me.
@@ -621,30 +621,26 @@ endif() | |||
# | |||
# this gets the libraries needed by TARGET in "-libx -liby ..." form | |||
# | |||
function(get_link_libraries OUT TARGET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check this one
This is fine for me, ADDITIONAL_LIBS correctly contains all the required libs, and i makes the code easier to read.
CMakeLists.txt
Outdated
${CMAKE_CURRENT_BINARY_DIR}/libvncclient.pc | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
) | ||
if(NOT WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot this one, on Windows would (silently?) fail
The OpenSSL libraries are already passed to all targets unconditionally anyway.
The list of libs linked against a target is known, so no need to query them again.
While at it add an imported target.
This should make things more bullet proof and portable.