-
Notifications
You must be signed in to change notification settings - Fork 9
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
Initial find script #14
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ryan Friedman <[email protected]>
Looks fine, waiting for CI & doc 🚀 |
cmake/FindASIO.cmake
Outdated
ASIO_VERSION_MAJOR | ||
ASIO_VERSION_MINOR | ||
ASIO_VERSION_PATCH | ||
ASIO_VERSION |
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.
Unclear - do we need to add ASIO_FOUND
to the REQUIRED_VARS
?
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.
Isn't it supposed to do it by itself? Only a test can make sure of that.
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.
Yea, it would be nicer if the CMake docs would explain this point. I'll do a test.
ASIO_VERSION_MINOR | ||
ASIO_VERSION_PATCH | ||
ASIO_VERSION | ||
VERSION_VAR ASIO_VERSION |
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.
Right now, the version is required. Since this works since asio 0.3.8
, I'd just recommend making it always part of the interface.
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.
What work since asio 0.3.8?
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.
Parsing the asio/version.hpp
for version info using the same regex.
Since 0.3.8, the version format has been the same and the regex is the same.
cmake/FindASIO.cmake
Outdated
target_include_directories(asio INTERFACE ${Asio_INCLUDE_DIR}) | ||
target_compile_definitions(asio | ||
INTERFACE | ||
# ASIO_STANDALONE |
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 would like to understand what to do with the asio macros:
https://think-async.com/Asio/asio-1.28.0/doc/asio/using.html#asio.using.macros
Should these all be exposed as CMake OPTION
s, then set here in target_compile_definitions
and a call to target_compile_options
?
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.
Hard to answer here. It was easy when cmake when creating the asio target. I guess when asio is system installed this is the header only version no?
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.
On ubuntu, I get the asio.cpp
file but not the asio_ssl.cpp
.
$ find /usr | grep asio | grep -v boost | grep cpp
/usr/include/asio/impl/src.cpp
From what I understand, which is used for the pre-compiled header, however 99% of asio is implemented in header files anyways. The find script here ideally should be able to support using asio in either mode. I have only gotten the header-only version working, pre-compiled has errors.
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 guess action with matrix is the way to test everything
Signed-off-by: Ryan Friedman <[email protected]>
Found a bug - if any of the major, minor, or patch versions are 0, the |
That is odd, because 0.0.1 shoudl be a valid version or 1.0.0 |
Correct, that is a valid version, however I don't think you are supposed to put We can assume if |
Seems fair |
* Remove extra variables that are already set Signed-off-by: Ryan Friedman <[email protected]>
This is the PR for #13, currently in draft to garner feedback.
Note: This work was done on behalf of AeroVironment Inc.