Skip to content

Commit 1b7b10e

Browse files
Fixed always rebuild issue in cmake. (#7512)
* 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.
1 parent 9c04329 commit 1b7b10e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

schema/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ endif()
1515

1616
# The include directory that will contain the generated schema headers.
1717
set(_program_schema__include_dir "${CMAKE_BINARY_DIR}/schema/include")
18-
18+
set(_program_schema__output_dir "${_program_schema__include_dir}/executorch/schema")
1919
# Source root directory for executorch.
2020
if(NOT EXECUTORCH_ROOT)
2121
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)
@@ -26,7 +26,7 @@ function(generate_program_schema _schema_srcs _schema_name)
2626
foreach(fbs_file ${_schema_srcs})
2727
string(REGEX REPLACE "[.]fbs$" "_generated.h" generated "${fbs_file}")
2828
list(APPEND _schema_outputs
29-
"${_program_schema__include_dir}/executorch/${generated}"
29+
"${_program_schema__output_dir}/${generated}"
3030
)
3131
endforeach()
3232

@@ -35,7 +35,7 @@ function(generate_program_schema _schema_srcs _schema_name)
3535
OUTPUT ${_schema_outputs}
3636
COMMAND
3737
${FLATC_EXECUTABLE} --cpp --cpp-std c++11 --gen-mutable --scoped-enums -o
38-
"${_program_schema__include_dir}/executorch/schema" ${_schema_srcs}
38+
"${_program_schema__output_dir}" ${_schema_srcs}
3939
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
4040
DEPENDS ${FLATC_EXECUTABLE} ${_schema_srcs}
4141
COMMENT "Generating ${_schema_name} headers"

0 commit comments

Comments
 (0)