[Stormlib] UNICODE needs to be PUBLIC#38696
Conversation
|
@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
e7efe7d to
fccdb49
Compare
|
vcpkg/ports/stormlib/vcpkg.json Line 4 in a1212c9 Please change |
|
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. |
|
#38834 removed the However I still find it a bit concerning that such changes to ABI (as opposed to API) can happen so easily. But I think that we now have the correct behaviour (keep CMake/toolchain defaults). Perhaps ports with libraries that use |
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
./vcpkg x-add-version --alland committing the result.