-
Notifications
You must be signed in to change notification settings - Fork 65
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 osx and win32 builds #83
Conversation
Hi @mjcarroll, let us know if there is any we (as RoboStack, from which this patch originates: osx and win) can do to help getting this PR merged, thanks! Downstream issue: RoboStack/ros-galactic#31 . |
# we have to find the absolute path to uuid as target_link_directories is not available before cmake 3.13 | ||
find_library(uuid_ABS_PATH ${UUID_LIBRARIES} PATHS ${UUID_LIBRARY_DIRS}) | ||
elseif(WIN32) | ||
set(uuid_ABS_PATH Rpcrt4.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.
Does this really make it work on Windows? Where does Rpcrt4.lib come from?
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 a system library: https://docs.microsoft.com/en-us/windows/win32/rpc/developing-32-bit-windows-applications .
pkg_check_modules(UUID REQUIRED uuid) | ||
# we have to find the absolute path to uuid as target_link_directories is not available before cmake 3.13 | ||
find_library(uuid_ABS_PATH ${UUID_LIBRARIES} PATHS ${UUID_LIBRARY_DIRS}) | ||
if(UNIX AND NOT APPLE) |
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 happens on macOS? If we are never finding the uuid library, how does it build/link against it?
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 macOS libuuid header and symbols are provided by the OS SDK/libc, so there is no need to provide additonal header directories or library to link, see gazebosim/gz-cmake#128 and gazebosim/gz-cmake#127 for a similar change on Ignition libraries or https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/uuid_generate.3.html for the macOS docs.
Howdy @traversaro , will take a look at this once I can get #87 landed to get a majority of the "cleanups" in. |
Great, thanks! |
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 think this is mostly good, question on definitions, and I may have introduced a linting error on the merge.
@Tobias-Fischer friendly ping |
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.
Looks reasonable to me with green CI.
Hi! Thanks for publishing this! I just cloned and failed building with following specs:
Command I tried: colcon build --symlink-install --merge-install --packages-select bond smclib bondcpp --event-handlers console_direct+ Output:
|
After trying this locally, we definitely need a fix in
Once those are all fixed, we can consider merging this. |
This is to avoid a warning on Windows. It is safe to do since the heartbeat timeout or period aren't expected to be outside the range a float can represent. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
OK, we also need ros2/rosidl#772 . And I also just pushed some additional fixes. With all of that in place, the last bit here is to fix the warnings about using |
Also make it allocate less memory in general. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
On osx, one should not link against the uuid library - it's in the system's path already.
On win32, there are several fixes needed:
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
so a DLL is created,add_definitions(-DNOMINMAX)
to avoid namespace clashes formin
andmax
, and the uuid library there is simply calledRpcrt4.lib
.