diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtUnityBuildHelpers.cmake | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cmake/QtUnityBuildHelpers.cmake b/cmake/QtUnityBuildHelpers.cmake index b66c6765ba..e804396f59 100644 --- a/cmake/QtUnityBuildHelpers.cmake +++ b/cmake/QtUnityBuildHelpers.cmake @@ -11,7 +11,14 @@ function(_qt_internal_validate_no_unity_build prefix) endfunction() function(qt_update_ignore_unity_build_sources target sources) - if (sources) - set_source_files_properties(${sources} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + if(sources) + # We need to add the TARGET_DIRECTORY scope for targets that have qt_internal_extend_target + # calls in different subdirectories, like in qtgraphs. + set(scope_args) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") + set(scope_args TARGET_DIRECTORY ${target}) + endif() + set_source_files_properties(${sources} ${scope_args} + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() endfunction() |