From 7a7b87baebe23ae2c290669fddedbcd8bdd19ef8 Mon Sep 17 00:00:00 2001 From: Evan Martine Date: Sat, 18 Jul 2026 18:44:35 -0400 Subject: [PATCH] Build: drop glaze /GL+/LTCG so MSVC Release links glaze's vcpkg port pins /GL and /LTCG on its imported target; those propagate to every consumer, and MSVC's LTCG code-gen pass fails on the coroutine handler bodies with C4737 -> LNK1257, breaking Release/MinSizeRel links. Override glaze's interface flags to drop LTCG so Release builds link cleanly. --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d2efb7..11528be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,19 @@ find_package(Drogon CONFIG REQUIRED) find_package(unofficial-sqlite3 CONFIG REQUIRED) find_package(glaze CONFIG REQUIRED) # c++ JSON abstraction +# glaze's vcpkg port pins /GL (whole-program opt) and /LTCG on its imported +# target for Release/MinSizeRel. Those flags propagate through gimuserver to +# every consumer, and MSVC's LTCG code-gen pass chokes on the coroutine +# HANDLEF bodies (e.g. UserInfo.cpp, GachaAction.cpp) with C4737 -> LNK1257. +# Drop the LTCG flags so Release links cleanly. We give up cross-TU inlining +# from glaze; the tradeoff is the build actually completing. +if (MSVC AND TARGET glaze::glaze) + set_property(TARGET glaze::glaze PROPERTY INTERFACE_COMPILE_OPTIONS + "/Zc:preprocessor;/permissive-;/Zc:lambda") + set_property(TARGET glaze::glaze PROPERTY INTERFACE_LINK_OPTIONS + "$<$:/INCREMENTAL:NO>;$<$:/INCREMENTAL:NO>") +endif() + add_subdirectory(packet-generator/assets/runtime/cpp) add_subdirectory(gimuserver)