ninja: error: dependency cycle
Summary
When using the Ninja generator in CMake, I cannot compile sila_cpp:
ninja: error: dependency cycle: examples/HelloSiLA2/HelloSiLA2Features_autogen -> examples/HelloSiLA2/CMakeFiles/HelloSiLA2Features_autogen -> examples/HelloSiLA2/HelloSiLA2Features_autogen/timestamp -> examples/HelloSiLA2/HelloSiLA2Features_autogen_timestamp_deps -> examples/HelloSiLA2/CMakeFiles/HelloSiLA2Features_autogen_timestamp_deps -> ../examples/HelloSiLA2/GreetingProvider/GreetingProviderImpl.cpp -> cmake_object_order_depends_target_HelloSiLA2Features -> examples/HelloSiLA2/GreetingProvider/grpc/GreetingProvider.grpc.pb.cc -> examples/HelloSiLA2/HelloSiLA2Features_autogen
Context
We're using Ninja as Generator.
-
sila_cpp
version: master - Operating System + version: Linux
- Compiler + version: clang 10, CMake 3.18.4
Steps to reproduce
mkdir build/
cmake .. -GNinja
cmake --build . # (or just ninja)
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
Possible fixes
Not really a fix, but I've tracked down that it's related to the GENERATED property here: https://gitlab.com/SiLA2/sila_cpp/-/blob/master/cmake/sila_cppConfig.cmake#L126
Without that property being set, Ninja does not error out. It's probably there for a reason and I'm not sure what the actual problem is and how to properly fix it.
Edited by Dominik Schmidt