cotire icon indicating copy to clipboard operation
cotire copied to clipboard

Target dependencies are broken for "make all_unity"?

Open kecsap opened this issue 10 years ago • 7 comments

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.

kecsap avatar Oct 25 '15 22:10 kecsap

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.

sakra avatar Oct 26 '15 13:10 sakra

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

gjasny avatar Jun 25 '16 21:06 gjasny

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?

gjasny avatar Jun 25 '16 22:06 gjasny

CMake issue: https://gitlab.kitware.com/cmake/cmake/issues/16165

gjasny avatar Jun 26 '16 21:06 gjasny

This just got merged into CMake master: https://gitlab.kitware.com/cmake/cmake/merge_requests/407

gjasny avatar Jan 20 '17 17:01 gjasny

The MANUALLY_ADDED_DEPENDENCIES property has been released with CMake 3.8.0

gjasny avatar Apr 24 '17 15:04 gjasny

Just had to work around this. I'd love to see this supported.

xaxxon avatar Oct 20 '17 03:10 xaxxon