Add an option to specify an existing flatbuffers compiler for cmake build. (#365)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/365
Cmake Xcode genrator creates an Xcode project for Executorch where some targets that require codegen steps become Run script build phases in Xcode, and some of them use `flatc` directly assuming it's available via $PATH, whereas it's not installed on MacOS by default. We can't use the one we build as a dependency either because there's no clear way to point to it for such Run script build phase (e.g. $<TARGET_FILE:flatc> provides a path that includes an Xcode own env var ${EFFECTIVE_PLATFORM_NAME} which is not possible to set when we generate the project with cmake). So here we'll follow the same approach as we already have for $PYTHON_EXCUTABLE and just pass a path to `flatc` binary too as one of the arguments to cmake.
Reviewed By: digantdesai, dbort
Differential Revision: D49324851
fbshipit-source-id: 2cdebb0404e4bfbbc610143fb00138ffcdd4fb82 A
Anthony Shoumikhin committed
30d915a4eb8b58fcff694750d2fc54a140a8024c
Parent: e04d9ba
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 9/15/2023, 6:38:58 PM