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

[enet] Export config, support BUILD_SHARED_LIBS, and add usage #20282

Merged
merged 4 commits into from
Sep 24, 2021

Conversation

Spirrwell
Copy link
Contributor

@Spirrwell Spirrwell commented Sep 22, 2021

This pull request addresses issue #20230 which I opened.

As the title says, this adds support for building enet as a shared library using CMake's built in BUILD_SHARED_LIBS. This also exports a config and outputs usage to make it more friendly to use.

I'm not certain that this matters with vcpkg, but I also bumped the CMake minimum version to 3.0.2 which I believe is the minimum version to support what was needed based on reading CMake documentation.

Extra Info:
I did open an issue on the enet repository here: lsalzman/enet#174 to ask about hopefully improving their existing CMakeLists.txt to be more vcpkg friendly. and it does seem that they are not against that, but it seems all previous efforts have gone without feedback anyway.

@ghost
Copy link

ghost commented Sep 22, 2021

CLA assistant check
All CLA requirements met.

@PhoebeHui PhoebeHui self-assigned this Sep 22, 2021
@PhoebeHui PhoebeHui added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Sep 22, 2021
Copy link
Contributor

@PhoebeHui PhoebeHui left a comment

Choose a reason for hiding this comment

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

@Spirrwell, thanks for the PR!

Could you also update the port-version in vcpkg.json file?

ports/enet/usage Outdated Show resolved Hide resolved
ports/enet/portfile.cmake Outdated Show resolved Hide resolved
ports/enet/CMakeLists.txt Outdated Show resolved Hide resolved
ports/enet/CMakeLists.txt Outdated Show resolved Hide resolved
ports/enet/CMakeLists.txt Outdated Show resolved Hide resolved
ports/enet/CMakeLists.txt Outdated Show resolved Hide resolved
ports/enet/portfile.cmake Outdated Show resolved Hide resolved
@Spirrwell
Copy link
Contributor Author

Ah neat, so I don't need a manual usage. Sorry this is my first time. I'm okay with everything, except the port version in vcpkg.json seems to be based on the latest release of enet v1.3.17, so I'm not sure what I should change it to.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You have modified or added at least one portfile where deprecated functions are used.

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/enet/portfile.cmake

@PhoebeHui
Copy link
Contributor

@Spirrwell, the port-version is a positive integer value that increases each time a vcpkg-specific change is made to the port. See port-version.

After all changes has been committed, we need to update the version database via command './vcpkg x-add-version enet', and submit the changes finally.

@PhoebeHui PhoebeHui added the info:reviewed Pull Request changes follow basic guidelines label Sep 23, 2021
@Spirrwell
Copy link
Contributor Author

Ah I see, sorry for all of my blunders. Thank you very much!

@PhoebeHui
Copy link
Contributor

No problem, thanks for your contribution!

@BillyONeal BillyONeal merged commit b8a9f2b into microsoft:master Sep 24, 2021
@BillyONeal
Copy link
Member

Thanks for de-staticifying :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants