forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Update vcpkg baseline commit

Open ranisalt opened this issue 6 months ago • 1 comments

Pull Request Prelude

Changes Proposed

Issues addressed:

How to test:

ranisalt avatar Jun 16 '25 23:06 ranisalt

Please fix the builds

ranisalt avatar Jun 16 '25 23:06 ranisalt

can you try do this for VS project? Solution Explorer -> Properties -> Configuration Properties -> C/C++ -> Command Line -> Additional Options -> add "/utf-8" While ago, I faced the same issue :|

error from build job Error: C:\a\forgottenserver\forgottenserver\build\vcpkg_installed\x64-windows\include\fmt\base.h(458): error C2338: static_assert failed: 'Unicode support requires compiling with /utf-8'

ArturKnopik avatar Jun 18 '25 14:06 ArturKnopik

@ranisalt Build fails in VS22 after that change!

I removed vcpkg_installed, updated vcpkg to newest commit, replaced baseline in vcpkg.json to ef7dbf94b9198bc58f45951adcf1f041fcbc5ea0 and tried to compile Debug x64 build in Visual Studio. It failed with error:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error	C2338	static_assert failed: 'Unicode support requires compiling with /utf-8'	theforgottenserver	C:\ots\forgottenserver\vcpkg_installed\x64-windows\x64-windows\include\fmt\base.h	458		

can you try do this for VS project? Solution Explorer -> Properties -> Configuration Properties -> C/C++ -> Command Line -> Additional Options -> add "/utf-8" While ago, I faced the same issue :|

I have this already set in VS by default TFS config: https://github.com/otland/forgottenserver/blob/191ebb5084a635a51d1dccc75ebf801a94bf98ef/vc17/theforgottenserver.vcxproj#L160 but it does not fix compilation problem. It should be set for vcpkg fmt compilation probably, not for TFS project.

To fix VS compilation problem I had to add:

#define FMT_UNICODE 0

under: https://github.com/otland/forgottenserver/blob/c8f06250eada35315c2ab789f0f7593fdbfadac2/src/otpch.h#L8

No credits for that, I just clicked 'GitHub Copilot' in VS and it was second answer 😄 (after add /utf-8 to properties, which was already set).

I also tested Docker and CMake build on Windows and both works.

gesior avatar Jun 19 '25 00:06 gesior

It seems that vcpkg already does that, but half assed like everything else Microsoft touches

I can't install Visual Studio

ranisalt avatar Jun 23 '25 17:06 ranisalt

Huh. How come it worked 😆

ranisalt avatar Jun 23 '25 20:06 ranisalt

@ranisalt @ArturKnopik

Huh. How come it worked 😆

It did not! It only worked for cmake Windows build, not VS compiler build.

EDIT: I found problem with VS. This line (<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>): https://github.com/otland/forgottenserver/pull/4793/files#diff-1b32b5497a1881aca6a2c3d9ea7672360483601484fa6713394cbd9a98ddec79R155 Should be added here: https://github.com/otland/forgottenserver/blob/9736af0287d2c0d1bec27b943e9cf3d9aa07f96f/vc17/settings.props#L17 To make it work in all 4 possible builds, not just in Release x64

gesior avatar Jul 03 '25 20:07 gesior