From f92b88f35b5504b9bc931f0648591cd84dd37606 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 1 Jan 2020 05:55:08 -0700 Subject: [PATCH] CMake: Omit Interrogate-generated sources from unity builds This fixes an include path error when building under a multi-configuration generator and with CMake 3.16+ --- cmake/macros/Interrogate.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 17d16d10ca..9001d05ff1 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -363,6 +363,15 @@ function(add_python_module module) DEPENDS host_interrogate_module ${infiles_abs} COMMENT "Generating module ${module}") + # CMake chokes on ${CMAKE_CFG_INTDIR} in source paths when unity builds are + # enabled. The easiest way out of this is to skip unity for those paths. + # Since generated Interrogate .cxx files are pretty big already, this doesn't + # really inconvenience us at all. + set_source_files_properties( + "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" + ${sources_abs} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION YES) + add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" ${sources_abs} ${extensions})