From 4ea6374a9ecdd32361b1f5b3dfd2209c357f6197 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sat, 17 Jan 2026 00:46:54 +0000 Subject: [PATCH] Ensure Win32 character set definitions are consistent Qt 6 made it so anything that linked with it had the defines that put the Win32 API into UTF-16 mode. That means that components (which we reuse the PCH for in multiple targets now) had incompatible defines, and the PCHs wouldn't work. Before CMP0204, CMake wouldn't set these defines at all except with the Visual Studio generators, so this wasn't causing any problems that caused a compile error when I tested a Ninja-based build. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ecef5f6323..052133c907 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,6 +408,13 @@ if (WIN32) -DNOMB # name conflict with MWGui::MessageBox -DNOGDI # name conflict with osgAnimation::MorphGeometry::RELATIVE ) + + # Put Win32 API into UTF-16 mode + # We really don't care, but targets linking with Qt 6 (not 5 and earlier) inherit this, and mixing and matching stops us reusing precompiled headers + add_compile_definitions( + _UNICODE + UNICODE + ) endif() if(OPENMW_USE_SYSTEM_BULLET)