Setting OBJECT_DEPENDS with an ExternalProject target works with Ninja build generator but not UNIX Makefiles
We have a case where we have a single source file that depends on the output of a target produced by ExternalProject_Add
. I found that with the Ninja generator that I can write
set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep)
and this produces the desired dependency graph. However, with Makefiles this fails with
make[2]: *** No rule to make target 'jemalloc_ep', needed by 'src/arrow/CMakeFiles/arrow_objlib.dir/memory_pool.cc.o'. Stop.
make[2]: *** Waiting for unfinished jobs....
Note that make jemalloc_ep
works fine, so for some reason at this level of the Makefile stack that target is not visible. This seems like a bug in CMake, but please let me know if we should do something differently
See relevant downstream issue https://github.com/apache/arrow/pull/5281