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

[Stormlib] UNICODE needs to be PUBLIC #38696

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lectem
Copy link

@Lectem Lectem commented May 11, 2024

Usually UNICODE can be set or not without issues. However in the case of stormlib, TCHAR is part of the API, which can lead to issues.

By default CMake uses MBCS instead of unicode:

This means that a project using CMake defaults would see sizeof(TCHAR)==1 while stormlib would see sizeof(TCHAR)==2.

Make the define PUBLIC so that targets linking stormlib::stormlib will automatically define it too.

Ideally, we would remove the use of this define entirely (this is something that must be controlled by the user, for example using a toolchain file), but this would break current users. We also can not use a feature to togggle this behaviour due to https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md#features

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@Lectem
Copy link
Author

Lectem commented May 11, 2024

@microsoft-github-policy-service agree

Usually UNICODE can be set or not without issues. However in the case of
stormlib, TCHAR is part of the API, which can lead to issues.

By default CMake uses MBCS instead of unicode:
- https://gitlab.kitware.com/cmake/cmake/-/blob/v3.27.7/Source/cmLocalVisualStudio7Generator.cxx#L805
- https://gitlab.kitware.com/cmake/cmake/-/blob/v3.27.7/Source/cmVisualStudio10TargetGenerator.cxx#L1516
- https://gitlab.kitware.com/cmake/cmake/-/blob/v3.27.7/Source/cmVisualStudioGeneratorOptions.cxx#L137

This means that a project using CMake defaults would see sizeof(TCHAR)==1
while stormlib would see sizeof(TCHAR)==2.

Make the define PUBLIC so that targets linking stormlib::stormlib will automatically define it too.

Ideally, we would remove the use of this define entirely (this is something that must be controlled by the user, for example using a toolchain file), but this would break current users.
We also can not use a feature to togggle this behaviour due to https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md#features
@JonLiu1993 JonLiu1993 self-assigned this May 13, 2024
@JonLiu1993 JonLiu1993 added the category:port-bug The issue is with a library, which is something the port should already support label May 13, 2024
@JonLiu1993
Copy link
Member

"port-version": 5,

Please change port-version to 6 and run command ./vcpkg x-add-version stormlib and commitr again

@JonLiu1993
Copy link
Member

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". That way, I can be aware that you've responded since you can't modify the tags.

@JonLiu1993 JonLiu1993 marked this pull request as draft May 13, 2024 09:11
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants