cotire icon indicating copy to clipboard operation
cotire copied to clipboard

Use DEPFILE for ninja generators

Open tru opened this issue 9 years ago • 2 comments

This is mostly a note for the future. Cmake just added depfile support for add_custom_command and the ninja generator. Hopefully this can be used instead of IMPLICIT_DEPENDS to calculate the dependencies for a PCH when ninja is used instead of make.

https://gitlab.kitware.com/cmake/cmake/merge_requests/66

tru avatar Aug 30 '16 15:08 tru

I fixed it in https://github.com/mkorotetsky/cotire/commit/6c29343d0b4bc67e564ecd8fe287b229032d13b0 Fix was written to work with ndk-r11c, clang and ninja under windows os. I had to base my code on old commit because recent repo changes have issue #146

mkorotetsky avatar Jul 24 '18 07:07 mkorotetsky

Worked for me after replacing -MMD with -MD and not adding DEPFILE property for the Unix Makefiles, i.e.

if (${CMAKE_GENERATOR} STREQUAL "Ninja")
    add_custom_command with DEPFILE
else ()
    add_custom_command without DEPFILE
endif ()

Altren avatar Jun 10 '19 16:06 Altren