From fccdb4963801c844be73e88a9ab3f9b1c08871ee Mon Sep 17 00:00:00 2001 From: Lectem Date: Sat, 11 May 2024 13:08:13 +0200 Subject: [PATCH 1/3] [Stormlib] UNICODE needs to be PUBLIC 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 --- ports/stormlib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stormlib/CMakeLists.txt b/ports/stormlib/CMakeLists.txt index e8bf793abf1c1c..581dc08753e413 100644 --- a/ports/stormlib/CMakeLists.txt +++ b/ports/stormlib/CMakeLists.txt @@ -265,7 +265,7 @@ target_link_libraries(stormlib PRIVATE ${LINK_LIBS}) target_compile_definitions(stormlib PRIVATE _7ZIP_ST BZ_STRICT_ANSI) if(WIN32) - target_compile_definitions(stormlib PRIVATE UNICODE _UNICODE) + target_compile_definitions(stormlib PUBLIC UNICODE _UNICODE) endif() if(NOT MSVC) From ad896af62ba098da3db7dda3f454a7951eef7df8 Mon Sep 17 00:00:00 2001 From: Lectem Date: Fri, 7 Jun 2024 23:18:48 +0200 Subject: [PATCH 2/3] Change stormlib version --- ports/stormlib/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stormlib/vcpkg.json b/ports/stormlib/vcpkg.json index 2727c3b6cd08b7..387c3c410cd2bb 100644 --- a/ports/stormlib/vcpkg.json +++ b/ports/stormlib/vcpkg.json @@ -1,7 +1,7 @@ { "name": "stormlib", "version-date": "2019-05-10", - "port-version": 5, + "port-version": 6, "description": "StormLib is a library for opening and manipulating Blizzard MPQ files", "dependencies": [ "bzip2", From 25a85cf524fc271eb9ed73588f64f0f24692e114 Mon Sep 17 00:00:00 2001 From: Lectem Date: Fri, 7 Jun 2024 23:19:37 +0200 Subject: [PATCH 3/3] Update port registry for stormlib --- versions/baseline.json | 2 +- versions/s-/stormlib.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index b78945cbcfea8b..621d7162cd5057 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8442,7 +8442,7 @@ }, "stormlib": { "baseline": "2019-05-10", - "port-version": 5 + "port-version": 6 }, "strict-variant": { "baseline": "0.5", diff --git a/versions/s-/stormlib.json b/versions/s-/stormlib.json index a3b7aa7d52f12e..8b25e83c9b7437 100644 --- a/versions/s-/stormlib.json +++ b/versions/s-/stormlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "716e1e685cabe4c6ff87e14056be76454558ed15", + "version-date": "2019-05-10", + "port-version": 6 + }, { "git-tree": "be1785249ddff2cfdcee25685c3775946edf9d6e", "version-date": "2019-05-10",