From 983c24043ff3a71d610292ce253b12e33d8f511d Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 29 Aug 2024 19:18:22 -0400 Subject: [PATCH 1/2] [Build] Use correct flatcc path for Windows The binary directory for Windows will have build type like Debug/Release at the end. For #4661 --- devtools/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devtools/CMakeLists.txt b/devtools/CMakeLists.txt index 776d421a8d3..1f0ee6c8aa3 100644 --- a/devtools/CMakeLists.txt +++ b/devtools/CMakeLists.txt @@ -157,13 +157,19 @@ file(MAKE_DIRECTORY ${_program_schema__include_dir}/executorch/devtools/bundled_program ) +if(WIN32) + set(_flatcc_bin_path ${_flatcc_source_dir}/bin/${CMAKE_BUILD_TYPE}/flatcc) +else() + set(_flatcc_bin_path ${_flatcc_source_dir}/bin/flatcc) +endif() + add_custom_command( OUTPUT ${_etdump_schema__outputs} COMMAND # Note that the flatcc project actually writes its outputs into the source # tree instead of under the binary directory, and there's no way to change # that behavior. - ${_flatcc_source_dir}/bin/flatcc -cwr -o + ${_flatcc_bin_path} -cwr -o ${_program_schema__include_dir}/executorch/devtools/etdump ${_etdump_schema__srcs} COMMAND rm -f ${_etdump_schema_cleanup_paths} From eec7e96ad527dd7d4683ff95d7626a35dbeca969 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 29 Aug 2024 19:28:32 -0400 Subject: [PATCH 2/2] Move comment. --- devtools/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devtools/CMakeLists.txt b/devtools/CMakeLists.txt index 1f0ee6c8aa3..775a7917b44 100644 --- a/devtools/CMakeLists.txt +++ b/devtools/CMakeLists.txt @@ -157,6 +157,10 @@ file(MAKE_DIRECTORY ${_program_schema__include_dir}/executorch/devtools/bundled_program ) + +# Note that the flatcc project actually writes its outputs into the source +# tree instead of under the binary directory, and there's no way to change +# that behavior. if(WIN32) set(_flatcc_bin_path ${_flatcc_source_dir}/bin/${CMAKE_BUILD_TYPE}/flatcc) else() @@ -166,9 +170,6 @@ endif() add_custom_command( OUTPUT ${_etdump_schema__outputs} COMMAND - # Note that the flatcc project actually writes its outputs into the source - # tree instead of under the binary directory, and there's no way to change - # that behavior. ${_flatcc_bin_path} -cwr -o ${_program_schema__include_dir}/executorch/devtools/etdump ${_etdump_schema__srcs}