Group unity build isn't working for objcpp sources
I have following situation: I have some modules, for each of them I enable unity build:
set_target_properties(${target} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE GROUP)
Then I split their main sources in groups and for each of the groups I do
set_source_files_properties(${source_group} PROPERTIES UNITY_GROUP "group_${counter}")
It is working ok. But later, during ixm::exit I am calling python script that generates code for cpp<->objcpp<->objc bridges and I want to add those bridges to unity build too.
I do
target_sources(${target} PRIVATE ${generated_bridges} ${generated_cpp_impls})
#group splitting loop omitted
set_source_files_properties(${generated_cpp_impls_group} PROPERTIES UNITY_GROUP "cpp_bridge_${counter}")
set_source_files_properties(${generated_bridges_group} PROPERTIES UNITY_GROUP "bridge_${counter}")
But all those files are compiled one by one, without unity and I don't understand what is the difference. I printed groups content and it is correct. If I try to do batch unity build it also correctly processes generated sources, but at the moment cmake mixes objcpp and cpp sources together in unity build and cpp compiler can't process them.
Edited by Brad King