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)