diff --git a/cmake/CommonModules/TinyHelpers.cmake b/cmake/CommonModules/TinyHelpers.cmake index 11db561c4..60f5d2499 100644 --- a/cmake/CommonModules/TinyHelpers.cmake +++ b/cmake/CommonModules/TinyHelpers.cmake @@ -458,8 +458,6 @@ function(tiny_fix_ccache_msvc) # anyway but I will replace the Zi to Z7 compiler option in both # CMAKE__FLAGS_ to be consistent 🤔 - tiny_disable_precompile_headers() - # Fix the MSVC debug information format by the CMake version set(isNewMsvcDebugInformationFormat FALSE) tiny_is_new_msvc_debug_information_format_325(isNewMsvcDebugInformationFormat) @@ -472,6 +470,13 @@ function(tiny_fix_ccache_msvc) tiny_fix_ccache_msvc_324() endif() + # Don't disable PCH if no fixes were applied + # The new MSVC debug information format flags method also supports multi-config generators + # The old replace /Zi by /Z7 method doesn't support multi-config generators + if(isNewMsvcDebugInformationFormat OR NOT TINY_IS_MULTI_CONFIG) + tiny_disable_precompile_headers() + endif() + endfunction() # Determine if the current platform needs fixes and the CMAKE_CXX_COMPILER_LAUNCHER