Skip to content

Commit 2db56a1

Browse files
shewu-quicdbort
andauthored
Add TODO comment for sdk/CMakeLists.txt
It is a short-term workaround for flatcc. Co-authored-by: Dave Bort <[email protected]>
1 parent 9980080 commit 2db56a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sdk/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@ add_custom_command(
108108
${CMAKE_SOURCE_DIR}/third-party/flatcc/bin/flatcc -cwr -o
109109
${_program_schema__include_dir}/executorch/sdk/etdump
110110
${_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.
111124
COMMAND
112125
rm -f ${CMAKE_SOURCE_DIR}/third-party/flatcc/bin/*
113126
${CMAKE_SOURCE_DIR}/third-party/flatcc/lib/*

0 commit comments

Comments
 (0)