Skip to content

VS: Change CMAKE_VS_WINRT_BY_DEFAULT to not implicitly enable WinRT

Ghost User requested to merge (removed):fix-vs-winrt-by-default into master

Original behavior would unconditionally enable WinRT for all projects so source file flag generation code can acknowledge existence WinRT being present and disable it for C language source files

Unintentional result of that is that WinRT is enabled for ALL projects, including C++ projects/source files with no way to disable it

This change uses CMAKE_VS_WINRT_BY_DEFAULT as a hint that platform is WinRT-by-default instead and sets global CompileAsWinRT flag to false unless it was explicitly requested by either VS_WINRT_COMPONENT option or /ZW compilation option - similar to what Windows Phone/Windows Store platform logic does

In case WinRT compilation is enabled for a project by either of aforementioned methods, C language source file override lo

Fixes: #20063 (closed)

Edited by Brad King

Merge request reports