Skip to content
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

Decouple linking to shlwapi from BUILD_TESTING #1468

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

scpeters
Copy link
Member

🦟 Bug fix

Fixing test failures discussed in #1414 (comment).

Summary

The windows builds were broken with -DBUILD_TESTING=OFF (see #1414 (comment)), so move the target_link_libraries call outside the if (BUILD_TESTING) logical block.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

The windows builds were broken with -DBUILD_TESTING=OFF,
so move the target_link_libraries call outside the
`if (BUILD_TESTING)` logical block.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Aug 19, 2024
@scpeters
Copy link
Member Author

testing with gz-sensors8 using a custom gazebodistro branch (see gazebo-tooling/gazebodistro@e76248c)

@@ -49,6 +49,11 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
TINYXML2::TINYXML2)

if (WIN32)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link against this library only if GZ_ENABLE_RELOCATABLE_INSTALL is enabled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe InstallationDirectories.cc is compiled unconditionally, so I think we can't avoid linking it.

an alternative suggestion from @iche033 in #1414 (comment) is to avoid using shlwapi by copying the joinPaths implementation from gz-common and use std::filesystem

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds like a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated implementation in #1469

@traversaro
Copy link
Contributor

Thanks for catching this error, my bad!

Copy link
Collaborator

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve this so we can merge and get CI back to green, but changing the implementation so we don't need shlwapi sounds good.

@@ -49,6 +49,11 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
TINYXML2::TINYXML2)

if (WIN32)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds like a good idea.

@scpeters scpeters merged commit 01c28aa into sdf14 Aug 19, 2024
13 checks passed
@scpeters scpeters deleted the scpeters/fix_windows_linking_without_tests branch August 19, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants