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+
This commit is contained in:
Sam Edwards 2020-01-01 05:55:08 -07:00
parent bff568798f
commit f92b88f35b
1 changed files with 9 additions and 0 deletions

View File

@ -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})