diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a5592f2..4256abdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Dev: Fixed compilation warnings on clang-cl. (#6528) - Dev: Fixed compilation error in tests with Clang 21. (#6519) - Dev: The LuaLS meta files moved from `docs/plugin-meta.lua` to `docs/lua-meta/globals.lua`. (#6530) +- Dev: Compile time definitions for `Windows.h` are now conditional based on `WIN32` instead of `MSVC`. (#6534) ## 2.5.4 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb33516b..4ff72e04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1076,6 +1076,10 @@ target_compile_definitions(${LIBRARY_PROJECT} PUBLIC IRC_NAMESPACE=Communi $<$:_WIN32_WINNT=0x0A00> # Windows 10 $<$:CHATTERINO_WITH_TESTS> + # Disable min/max macros from Windows.h + $<$:NOMINMAX> + # Exclude some headers when including Windows.h + $<$:WIN32_LEAN_AND_MEAN> ) set(_c2_qt_defs @@ -1241,9 +1245,6 @@ if (MSVC) -Wno-missing-designated-field-initializers ) endif() - - # Disable min/max macros from Windows.h - target_compile_definitions(${LIBRARY_PROJECT} PUBLIC NOMINMAX) else () target_compile_options(${LIBRARY_PROJECT} PUBLIC -Wall