[Bf-blender-cvs] [9ab0247b6ef] master: MSVC: Don't share pch between debug and release builds.

Ray Molenkamp noreply at git.blender.org
Tue Jun 25 23:27:20 CEST 2019


Commit: 9ab0247b6efcf0659648d006b3d216d0fd708cae
Author: Ray Molenkamp
Date:   Tue Jun 25 15:27:21 2019 -0600
Branches: master
https://developer.blender.org/rB9ab0247b6efcf0659648d006b3d216d0fd708cae

MSVC: Don't share pch between debug and release builds.

Precompiled headers were sharing the PCH file between debug and
release builds which is 'bad'. Adding the configuration to the
path fixes the issue.

Reported on chat by @mano-wii

===================================================================

M	build_files/cmake/macros.cmake

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index e6ae3b5efdb..e781186ca74 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1243,7 +1243,7 @@ macro(blender_precompile_headers target cpp header)
   if(MSVC)
     # get the name for the pch output file
     get_filename_component( pchbase ${cpp} NAME_WE )
-    set( pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${pchbase}.pch" )
+    set( pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${pchbase}.pch" )
 
     # mark the cpp as the one outputting the pch
     set_property(SOURCE ${cpp} APPEND PROPERTY OBJECT_OUTPUTS "${pchfinal}")



More information about the Bf-blender-cvs mailing list