File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,19 @@ add_custom_command(
108
108
${CMAKE_SOURCE_DIR} /third-party/flatcc/bin/flatcc -cwr -o
109
109
${_program_schema__include_dir} /executorch/sdk/etdump
110
110
${_etdump_schema__srcs}
111
+ # TODO(dbort): flatcc installs its files directly in its source directory
112
+ # instead of under CMAKE_BINARY_DIR, and it has no options to avoid
113
+ # doing this. We build flatcc twice in the executorch build: once to get
114
+ # the `flatcc` host commandline tool, and once to get the (potentially
115
+ # cross-compiled) target runtime library. The host build will put its outputs
116
+ # in the source tree, making the cross-compiling target build think that
117
+ # the outputs have already been built. It will then try to link against the
118
+ # host-architecture libraries, failing when cross-compiling. To work around
119
+ # this, delete the host outputs after running this command (which only runs
120
+ # when setting up the cmake files, not when actually building). This leaves
121
+ # room for the target build to put its own files in the source tree. We should
122
+ # try to remove this hack, ideally by submitting an upstream PR that adds an
123
+ # option to change the installation location.
111
124
COMMAND
112
125
rm -f ${CMAKE_SOURCE_DIR} /third-party/flatcc/bin/*
113
126
${CMAKE_SOURCE_DIR} /third-party/flatcc/lib/*
You can’t perform that action at this time.
0 commit comments