From a85610a73062b2558cf87571ed2a3d0a3e4ed394 Mon Sep 17 00:00:00 2001 From: cptspacemanspiff <19273992+cptspacemanspiff@users.noreply.github.com> Date: Sat, 4 Jan 2025 14:47:29 -0800 Subject: [PATCH 1/2] Fixed always rebuild issue in cmake. The generated files were located in include/executorch/schema/program_generated.h CMake was expecting files in include/executorch/program_generated.h Presumably this was a change at some point, and the expected output from cmake never got updated. --- schema/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/CMakeLists.txt b/schema/CMakeLists.txt index 5a4013f43e0..f83a3514257 100644 --- a/schema/CMakeLists.txt +++ b/schema/CMakeLists.txt @@ -26,10 +26,10 @@ function(generate_program_schema _schema_srcs _schema_name) foreach(fbs_file ${_schema_srcs}) string(REGEX REPLACE "[.]fbs$" "_generated.h" generated "${fbs_file}") list(APPEND _schema_outputs - "${_program_schema__include_dir}/executorch/${generated}" + "${_program_schema__include_dir}/executorch/schema/${generated}" ) endforeach() - + # Generate the headers from the .fbs files. add_custom_command( OUTPUT ${_schema_outputs} From 32d0b14f7ef3dad57afd38c0338eb311752cc1d9 Mon Sep 17 00:00:00 2001 From: cptspacemanspiff <19273992+cptspacemanspiff@users.noreply.github.com> Date: Fri, 10 Jan 2025 04:16:07 -0800 Subject: [PATCH 2/2] Added common variable for schema output directory and removed accidental whitespace. --- schema/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/schema/CMakeLists.txt b/schema/CMakeLists.txt index f83a3514257..64f8821da1e 100644 --- a/schema/CMakeLists.txt +++ b/schema/CMakeLists.txt @@ -15,7 +15,7 @@ endif() # The include directory that will contain the generated schema headers. set(_program_schema__include_dir "${CMAKE_BINARY_DIR}/schema/include") - +set(_program_schema__output_dir "${_program_schema__include_dir}/executorch/schema") # Source root directory for executorch. if(NOT EXECUTORCH_ROOT) set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) @@ -26,16 +26,16 @@ function(generate_program_schema _schema_srcs _schema_name) foreach(fbs_file ${_schema_srcs}) string(REGEX REPLACE "[.]fbs$" "_generated.h" generated "${fbs_file}") list(APPEND _schema_outputs - "${_program_schema__include_dir}/executorch/schema/${generated}" + "${_program_schema__output_dir}/${generated}" ) endforeach() - + # Generate the headers from the .fbs files. add_custom_command( OUTPUT ${_schema_outputs} COMMAND ${FLATC_EXECUTABLE} --cpp --cpp-std c++11 --gen-mutable --scoped-enums -o - "${_program_schema__include_dir}/executorch/schema" ${_schema_srcs} + "${_program_schema__output_dir}" ${_schema_srcs} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${FLATC_EXECUTABLE} ${_schema_srcs} COMMENT "Generating ${_schema_name} headers"