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

[simbody] uniform target names and add usage #28863

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

FabienPean
Copy link
Contributor

Describe the pull request

  • Update the library to latest ref to solve an end-user side issue when using the library on windows-static
  • Uniformize library names between shared and static with a patch
  • Add a usage file
  • What does your PR fix?

    N.A.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    Same triplets as before on vcpkg side (i.e. !uwp)

  • Does your PR follow the maintainer guide?

    Yes, applies the following

    Static and shared variants often should be renamed to a common scheme. This enables consumers to use a common name and be ignorant of the downstream linkage. This is safe because we only make one at a time available.
    If a library generates CMake integration files (foo-config.cmake), renaming must be done through patching the CMake build itself instead of simply calling file(RENAME) on the output archives/LIBs.

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

github-actions[bot]
github-actions bot previously approved these changes Jan 10, 2023
@MonicaLiu0311 MonicaLiu0311 added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist category:port-bug The issue is with a library, which is something the port should already support labels Jan 11, 2023
github-actions[bot]
github-actions bot previously approved these changes Jan 11, 2023
@MonicaLiu0311 MonicaLiu0311 added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Jan 12, 2023
@vicroms vicroms merged commit 4c5be28 into microsoft:master Jan 12, 2023
Comment on lines +76 to +81
set(SHARED_TARGET ${SimTKSIMBODY_LIBRARY_NAME})
-set(STATIC_TARGET ${SimTKSIMBODY_LIBRARY_NAME}_static)
+set(STATIC_TARGET ${SimTKSIMBODY_LIBRARY_NAME})
set(SHARED_TARGET_VN ${SimTKSIMBODY_LIBRARY_NAME}${VN})
-set(STATIC_TARGET_VN ${SimTKSIMBODY_LIBRARY_NAME}${VN}_static)
+set(STATIC_TARGET_VN ${SimTKSIMBODY_LIBRARY_NAME}${VN})
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and for SimTKcommon, SimTKmath:
The maintainer guidelines allow to rename binaries in order to have the same name for static vs. dynamic.
But IMO this doesn't extend to renaming exported CMake targets. The usage suggestion can use generator expressions, cf. zstd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok fine by me, but then does it even matter to rename the libraries if it is not related? The downstream user would just rely on the usage file no matter the library name. I would completely remove the patch to thin back the port in that case.

Simbody provides CMake targets:

find_package(Simbody CONFIG REQUIRED)
target_link_libraries(main PRIVATE SimTKcommon SimTKmath SimTKsimbody)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would guess that the actual usage only needs SimTKsimbody(-static), if properly exported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The targets are indeed incremental (SimTKcommon ⊂ SimTKmath ⊂ SimTKsimbody). Though each target is seldom usable and I have seen libraries relying on a subset specifically. Unless CMake can strip correctly simbody if someone use math only, then IMO usage file should reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants