Target dependencies are broken for "make all_unity"?
Hi,
I tried to apply the latest Cotire for my project, but the target dependencies are completely broken if I try to use unity build. My targets are in different subdirectories and the dependencies are specified with add_dependencies(). I execute: "make all_unity". I cotired almost all of my targets.
For the generated unity target, cotire can only copy target dependencies established through target_link_libraries. CMake does not provide a way to obtain target dependencies specified with add_dependencies. As a work-around, you have to set up necessary unity target dependencies manually.
Let me try to add a dependency getter to CMake 3.7. I have also a test case available at gjasny/cotire@4f1b89893cd79a5abd95af1b539b87ab081a2e03
CC: @grover
I wrote a PoC getter for the utility dependencies in CMake: gjasny/cmake@f85065ad781918e3ebf3dd336dcec8fe6e3f4cac
You can retrieve the deps via get_target_property(_deps example DEPENDENCIES). Where would you add that information in cotire.cmake?
CMake issue: https://gitlab.kitware.com/cmake/cmake/issues/16165
This just got merged into CMake master: https://gitlab.kitware.com/cmake/cmake/merge_requests/407
The MANUALLY_ADDED_DEPENDENCIES property has been released with CMake 3.8.0
Just had to work around this. I'd love to see this supported.