-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add support for GnuTLS #663
base: master
Are you sure you want to change the base?
Changes from all commits
23fed28
49561d2
ad9271b
7444c04
9d94ec5
6ef17e8
cc9d4d8
1367a85
8b9ee52
d3778b3
6eb8d09
52ef72d
10e6871
0aa3288
abf1536
5746ffd
a9da0f2
ac1ecbb
195e1f9
50688b7
d5a3ef2
dc98256
c0ea73c
11bc857
9867f96
3a4a8e0
a6b4579
a018a30
c7d4bb6
bf54b28
98c658f
36fc136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
CMakeLists.txt.user* | ||
|
||
# Build artifacts | ||
build/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, don't add this. Builds should not happen inside the source tree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The repository's ReadMe suggests doing just that. I've seen several other projects follow the same format. What's so wrong with adding the build/ directory to this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the very least, if it's going to be added to the repository, it needs to happen in it's own pull request. There are a variety of reasons why builds should not be done inside the source directory, but one specific one that I'll share to help you research the topic, is that cmake natively understands multiple configurations. If you put the build inside the source directory, you pre-clude the ability to have multiple build configurations at the same time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can remove it. It's just that it was making my life easier as I've always built libraries this way. |
||
|
||
# VS code settings | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,20 @@ IF (POLICY CMP0074) | |
CMAKE_POLICY(SET CMP0074 NEW) | ||
ENDIF () | ||
|
||
SET (MQTT_TLS_OPENSSL "MQTT_TLS_OPENSSL") | ||
SET (MQTT_TLS_GNUTLS "MQTT_TLS_GNUTLS") | ||
|
||
IF (MQTT_USE_TLS) | ||
MESSAGE (STATUS "TLS enabled") | ||
IF (MQTT_USE_TLS STREQUAL ${MQTT_TLS_GNUTLS}) | ||
MESSAGE (STATUS "Using GNUTLS") | ||
IF (MQTT_BOOST_ASIO_GNUTLS_INCLUDE STREQUAL "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why namespace the include directory like this? If you need the ability to insert additional include directories, just name it "MQTT_ADDITIONAL_INCLUDE" or something, and take list as the argument. Are you sure CMake doesn't already have a specific feature for this built in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't find a native Cmake way of doing that. As per this stack overflow post, the other option we have is to let consumers set CXX flags which doesn't seem too appealing. I can change it to be MQTT_ADDITIONAL_INCLUDES and accept a list if that works There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I don't see the benefit of making something that clearly applies in a generic way named in a feature specific way. I think it'll cause more confusion to people to have it named MQTT_BOOST_ASIO_GNUTLS_INCLUDE. @redboltz can you offer some guidance? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got confused. I don't understand what you want to do, so far. |
||
MESSAGE (FATAL_ERROR "The MQTT_BOOST_ASIO_GNUTLS_INCLUDE variable needs to be set to the path of the boost-asio-gnutls headers") | ||
ENDIF () | ||
ELSE () | ||
MESSAGE (STATUS "Using OpenSSL") | ||
SET (MQTT_USE_TLS ${MQTT_TLS_OPENSSL}) | ||
ENDIF() | ||
ELSE () | ||
MESSAGE (STATUS "TLS disabled") | ||
ENDIF () | ||
|
@@ -130,9 +142,13 @@ ELSE () | |
ENDIF () | ||
|
||
IF (MQTT_USE_TLS) | ||
FIND_PACKAGE (OpenSSL REQUIRED) | ||
IF (MQTT_USE_STATIC_OPENSSL) | ||
FIND_PACKAGE (ZLIB REQUIRED) | ||
IF (MQTT_USE_TLS STREQUAL ${MQTT_TLS_GNUTLS}) | ||
FIND_PACKAGE (GnuTLS REQUIRED) | ||
ELSE () | ||
FIND_PACKAGE (OpenSSL REQUIRED) | ||
IF (MQTT_USE_STATIC_OPENSSL) | ||
FIND_PACKAGE (ZLIB REQUIRED) | ||
ENDIF () | ||
ENDIF () | ||
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.
There's no need to delete this. Github doesn't reuse virtual machines.
That being said, why bother with the copy? I'd rather you just clone the repository directly to the destination. https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository
And you should make sure to specify --depth=1, to avoid large downloads.
Alternatively, if somehow doing a direct clone isn't possible, then I'd rather it be a move operation. You can just "mv" the entire "include" folder directly to /usr/local/include/boost-asio-gnutls.
Lastly, why does this even need to be moved to /usr/local ? Can't you just specify the full path ? -DMQTT_BOOST_ASIO_GNUTLS_INCLUDE=$(realpath boost-asio-gnutls/include)
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.
sure, I can do that too.