Skip to content

Commit

Permalink
cmake avoided possible disabled PCH
Browse files Browse the repository at this point in the history
Restrict disabling PCH if the ccache is used as the compiler launcher
with the MSVC compiler.
  • Loading branch information
silverqx committed Oct 20, 2023
1 parent dfd253d commit ffcfe60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/CommonModules/TinyHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@ function(tiny_fix_ccache_msvc)
# anyway but I will replace the Zi to Z7 compiler option in both
# CMAKE_<C|CXX>_FLAGS_<CONFIG> 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)
Expand All @@ -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
Expand Down

0 comments on commit ffcfe60

Please sign in to comment.