Commits


Sutou Kouhei authored and GitHub committed 53ac2a00aa9
ARROW-6858: [C++] Simplify transitive build option dependencies (#14224) This approach adds "depends" information to each (bool) build options and use it to resolve transitive build option dependencies automatically. This approach implements topological sort in CMake to resolve transitive dependencies. Another approach proposed in the associated Jira issue: It creates a Python script that generates a CMake code (.cmake file) that handles transitive dependencies. Dependencies information are written in the Python script. I think that this approach is better than the another approach because: * We can put option definitions and their dependencies into the same place. (We don't need to put them into .cmake and .py.) * We don't need to regenerate a .cmake file when we update option dependencies. * We can specify dependencies information with a simple way. (We can just add "DEPENDS ARROW_XXX ARROW_YYY ..." to an option definition.) Here are downsides of this approach: * We need to maintain topological sort implementation in CMake. Because CMake doesn't provide a topological sort feature that is used in CMake internally. But topological sort algorithm is well-known (Tarjan's algorithm was published at 1976) and its implementation in this approach has only 20+ CMake lines. I think that we can maintain it. * This can't support complex conditions such as "ARROW_X AND NOT ARROW_Y". But we don't have any complex condition for now. Lead-authored-by: Sutou Kouhei <kou@clear-code.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Yibo Cai <yibo.cai@arm.com>